//package com.ht.pms.core.service.impl;
//
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.alibaba.fastjson.JSONPath;
//import com.baomidou.mybatisplus.mapper.EntityWrapper;
//import com.baomidou.mybatisplus.mapper.Wrapper;
//import com.dingtalk.api.DefaultDingTalkClient;
//import com.dingtalk.api.DingTalkClient;
//import com.dingtalk.api.request.OapiMediaUploadRequest;
//import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
//import com.dingtalk.api.response.OapiMediaUploadResponse;
//import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response;
//import com.ht.pms.core.dto.*;
//import com.ht.pms.core.dto.dingding.SendDingdingMsgVo;
//import com.ht.pms.core.feign.EipoutFeign;
//import com.ht.pms.core.service.*;
//import com.ht.pms.core.util.HanyuPinyinHelper;
//import com.ht.pms.core.util.WordAction;
//import com.ht.ussp.core.Result;
//import com.ht.ussp.util.DateUtil;
//import com.ht.ussp.util.JsonUtil;
//import com.taobao.api.FileItem;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//import org.springframework.util.CollectionUtils;
//import org.springframework.util.StringUtils;
//
//import java.math.BigDecimal;
//import java.text.SimpleDateFormat;
//import java.util.*;
//
///**
// * @Auther: 喻尊龙
// * @Date: 2018/11/20 17:29
// * @Description:
// */
//@Service
//public class DDServerImpl implements DDService {
//
//    private static final Logger LOG = LoggerFactory.getLogger(DDServerImpl.class);
//    /**
//     * 补卡申请
//     */
//    private final static String FORGET_CARD_APPLICATION = "PROC-178CB98B-18B7-44EE-99FD-4A55ACED72EF";
//    /**
//     * 外出申请
//     */
//    private final static String GO_OUT_APPLICATION = "PROC-QNALQBPV-T3MQ63LSSE8WG267Y2MM2-UX6FLRAJ-1";
//    /**
//     * 出差申请
//     */
//    private final static String ON_BUSINESS_APPLICATION = "PROC-3KYJ33FV-LW2TMF9SPO3DOFWY0QEU1-IIRWB8EJ-2";
//    /**
//     * 加班申请
//     */
//    private final static String OVER_TIME_APPLICATION = "PROC-52IKRYIV-ECAQAII1S1RZCV35FYBX1-W0I43BAJ-2";
//    /**
//     * 房产总部加班
//     */
//    private final static String OVER_TIME_APPLICATION_HOUSE = "PROC-FFYJAWEV-FRM1HAWZZNCKVGIINAKT1-R5G9W8QJ-E";
//    /**
//     * 请假
//     */
//    private final static String VOCATION_APPLICATION = "PROC-TXEKLZ3V-T4AQDY6IN2WBV02GHM6R3-PFN8SAAJ-3";
//
//
//    /**
//     * 外出申请
//     */
//    private final static String GO_OUT_APPLICATION_FC = "PROC-0KYJJ80V-72UY56IPPR5PM0ZHFP0Y2-TL3OQBMJ-K";
//    /**
//     * 出差申请
//     */
//    private final static String ON_BUSINESS_APPLICATION_FC = "PROC-FFYJVEZU-BKRYYQW0T6EPV18EJEPH3-MYJAY8MJ-J";
//    /**
//     * 加班申请
//     */
//    private final static String OVER_TIME_APPLICATION_FC = "PROC-5FYJXW8W-V4SYJCSEO5R3U3B86HG72-NNAEY8MJ-H";
//
//    /**
//     * 请假
//     */
//    private final static String VOCATION_APPLICATION_FC = "PROC-3KYJSOGV-NDSYWRVTQXXUNUGM07BU1-81U6Y8MJ-1";
//
//    /**
//     * 融易行报销
//     */
//    private final static String APPLY_MONEY_RYX = "PROC-F4604728-0F1C-409A-9A10-096011AC1147";
//    /**
//     * 富成报销
//     */
//    private final static String APPLY_MONEY_FC = "PROC-6AFA1615-8A89-4ADA-9BE8-EA4A54268B1E";
//    /**
//     * 富成借款
//     */
//    private final static String BORROW_MONEY_FC = "PROC-1E06D0B9-1193-4AE1-B717-B3CD984EE697";
//    /**
//     * 富成法务费
//     */
//    private final static String LAW_FEE_FC = "PROC-DFYJXX2V-4J0Z6VHFO6TPXTO51WJS1-7HLHEKMJ-2";
//
//    /**
//     * 富成资金调拨
//     */
//    private final static String BANK_TREASURER_FC = "PROC-RIYJTXWV-EIZYJPMLPRHYZWIDDQBM1-TPS1ZJMJ-N";
//
//    private final static String NORMAL_FEE_FC = "PROC-CFYJQ98V-D9A2I0MC45E4OBJ0034T2-JC5266RJ-T";
//
//
//
//    @Autowired
//    private EipoutFeign eipoutFeign;
//
//    @Autowired
//    private OverTimeDetailService overTimeDetailService;
//
//    @Autowired
//    private HolidayService holidayService;
//
//    private String token = "";
//
//    private List<Holiday> holidays;
//
//    private String companyType;
//
//    private String overTimeProcessCode;
//    private String goOutProcessCode;
//    private String onBusinessProcessCode;
//
//    @Value("${pms.isSendToTruePerson}")
//    private String isSend2TruePerson;
//
//    @Value("${pms.sendUserId}")
//    private String sendUserId;
//
//    @Value("${pms.fc.agentId}")
//    private Long agentIdFc;
//
//    @Value("${pms.ryx.agentId}")
//    private Long agentIdRyx;
//
//    @Autowired
//    private ApplyReimbursementService applyReimbursementService;
//
//    @Autowired
//    private ApplyReimbursementProcessService applyReimbursementProcessService;
//
//    @Autowired
//    private ApplyReimbursementDetailService applyReimbursementDetailService;
//
//    @Autowired
//    private DdUserSynService ddUserSynService;
//
//    @Autowired
//    private WordAction wordAction;
//
//    @Autowired
//    private VocationApproveService vocationApproveService;
//
//    @Autowired
//    private UserVocationHoursService userVocationHoursService;
//
//    @Autowired
//    private ApplyReimbursementLogService applyReimbursementLogService;
//
//
//
//    /**
//     *
//     * @param approveStartTime yyyy-MM-dd HH:mm:ss
//     * @param approveEndTime yyyy-MM-dd HH:mm:ss
//     * @throws Exception
//     */
//    @Override
//    public void synDDOverTimeData(String approveStartTime,String approveEndTime,String companyType,String overTimeDate,boolean isHouse) throws Exception {
//
//        //获取法定节假日
//        String year = DateUtil.formatDate("yyyy", DateUtil.getNow());
//        holidays = holidayService.selectList(new EntityWrapper<Holiday>().eq("date_year", year));
//        //获取钉钉token
//        Map<String,Object> tokenReq = new HashMap<>();
//        tokenReq.put("companyType",companyType);
//        Result tokenResult = eipoutFeign.getDDTokenOther(tokenReq);
//        if("0000".equals(tokenResult.getReturnCode())){
//            this.companyType = companyType;
//            if("fc".equals(companyType)){
//                this.overTimeProcessCode=OVER_TIME_APPLICATION_FC;
//                this.goOutProcessCode=GO_OUT_APPLICATION_FC;
//                this.onBusinessProcessCode=ON_BUSINESS_APPLICATION_FC;
//            }else {
//                this.overTimeProcessCode=isHouse?OVER_TIME_APPLICATION_HOUSE:OVER_TIME_APPLICATION;
//                this.goOutProcessCode=GO_OUT_APPLICATION;
//                this.onBusinessProcessCode=ON_BUSINESS_APPLICATION;
//            }
//            Map<String,Object> resultMap = JsonUtil.json2Map(JsonUtil.obj2Str(tokenResult.getData()));
//            token = resultMap.get("accessToken")+"";
//        }else {
//            throw new Exception("获取钉钉token异常！"+tokenResult.getReturnCode()+tokenResult.getCodeDesc());
//        }
//
//        //获取当月全部加班申请审批记录
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//            List<OverTimeDetail> overTimeDetails = new ArrayList<>();
//            List<String> approveIds = null;
//
//            Map<String, Object> approveIdsResult = requestForApproveIdsFromEip(this.overTimeProcessCode, cursor, approveStartTime, approveEndTime);
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//
//
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                break;
//            }
//            for (String approveId : approveIds) {
//                LOG.info("加班申请审批单号：[{}]" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String overTimeDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    //处理加班申请
//                    if("fc".equals(this.companyType)){
//                        overTimeDetails = getOverTimeDetailFc(overTimeDetailResp, approveId,this.companyType);
//                    }else {
//                        overTimeDetails = getOverTimeDetail(overTimeDetailResp, approveId,this.companyType);
//                    }
//
//                }
//
//                for (OverTimeDetail overTimeDetail : overTimeDetails) {
//                    Map<String, Object> overTimeResult = requestForOverTimeFromEip(overTimeDetail);
//                    if (overTimeResult != null) {
//                        String kqResp = overTimeResult.get("kqResp") + "";
//                        getKqDetail(overTimeDetail, kqResp);
//                    }
//                }
//
//                if (!CollectionUtils.isEmpty(overTimeDetails)) {
//                    overTimeDetailService.insertBatch(overTimeDetails);
//                }
//            }
//        }
//
//        updateTimeRecordFromGoOutApplyInfo(approveStartTime,approveEndTime);
//
//        updateTimeRecordFromOnBusinessInfo(approveStartTime,approveEndTime);
//
//        updateOverTimeHours(overTimeDate);
//
//        overTimeDetailService.updateJodCode();
//
//        LOG.info("============================结束");
//
//
//    }
//
//    private String getToken(String companyType) throws Exception {
//        String token = "";
//        //获取钉钉token
//        Map<String,Object> tokenReq = new HashMap<>();
//        tokenReq.put("companyType",companyType);
//        Result tokenResult = eipoutFeign.getDDTokenOther(tokenReq);
//        if("0000".equals(tokenResult.getReturnCode())){
//            Map<String,Object> resultMap = JsonUtil.json2Map(JsonUtil.obj2Str(tokenResult.getData()));
//            token = resultMap.get("accessToken")+"";
//        }else {
//            throw new Exception("获取钉钉token异常！"+tokenResult.getReturnCode()+tokenResult.getCodeDesc());
//        }
//        return token;
//    }
//
//
//    @Override
//    public void createAplyInfoExcel(String startTime,String endTime,String companyType,String approveType) throws Exception {
//
//        //获取钉钉token
//        token = getToken(companyType);
//
//        //获取当月全部加班申请审批记录
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//
//            List<String> approveIds = null;
//
//            Map<String, Object> approveIdsResult = null;
//            String processCode = "";
//            if("ryx".equals(approveType)){
//                processCode = APPLY_MONEY_RYX;
//                approveIdsResult = requestForApproveIdsFromEip(APPLY_MONEY_RYX, cursor, startTime, endTime);
//            }else if("fc".equals(approveType)){
//                processCode = APPLY_MONEY_FC;
//                approveIdsResult = requestForApproveIdsFromEip(APPLY_MONEY_FC, cursor, startTime, endTime);
//            }else if("fc_normal".equals(approveType)) {
//                processCode = NORMAL_FEE_FC ;
//                approveIdsResult = requestForApproveIdsFromEip(NORMAL_FEE_FC, cursor, startTime, endTime);
//            }
//
//
//
//
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                break;
//            }
//            // 每天新增审批
//            for (String approveId : approveIds) {
//                LOG.info("审批单号：[{}]" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String overTimeDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    Map<String,Object> resultMap = getExpenseAccountForRyx(overTimeDetailResp,approveId,companyType);
//                    ApplyReimbursement applyReimbursement = (ApplyReimbursement)resultMap.get("applyReimbursement");
//                    if(applyReimbursement != null){
//                        ApplyReimbursementLog applyReimbursementLog = new ApplyReimbursementLog();
//                        BeanUtils.copyProperties(applyReimbursement,applyReimbursementLog);
//                        applyReimbursementLog.setProcessCode(processCode);
//                        applyReimbursementLogService.insert(applyReimbursementLog);
//                    }
//                }
//            }
//
//        }
//        LOG.info("============================费用报销单结束结束");
//
//
//    }
//
//    @Override
//    public void createLawFeeInfo(String startTime,String endTime,String companyType) throws Exception {
//
//        //获取钉钉token
//        token = getToken(companyType);
//
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//
//            List<String> approveIds = null;
//
//            Map<String, Object> approveIdsResult = null;
//            String processCode = "";
//            if("fc".equals(companyType)){
//                processCode = LAW_FEE_FC;
//                approveIdsResult = requestForApproveIdsFromEip(LAW_FEE_FC, cursor, startTime, endTime);
//
//            }
//
//
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                break;
//            }
//            // 每天新增审批
//            for (String approveId : approveIds) {
//                LOG.info("审批单号：[{}]" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String overTimeDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    Map<String,Object> resultMap = getLawFeeBillForFc(overTimeDetailResp,approveId,companyType);
//                    ApplyReimbursement applyReimbursement = (ApplyReimbursement)resultMap.get("applyReimbursement");
//                    if(applyReimbursement != null){
//                        ApplyReimbursementLog applyReimbursementLog = new ApplyReimbursementLog();
//                        BeanUtils.copyProperties(applyReimbursement,applyReimbursementLog);
//                        applyReimbursementLog.setProcessCode(processCode);
//                        applyReimbursementLogService.insert(applyReimbursementLog);
//                    }
//                }
//            }
//
//        }
//
//        LOG.info("============================富成法务费报销单结束");
//
//    }
//
//    /**
//     * 资金调拨
//     * @throws Exception
//     */
//    @Override
//    public void createBankTreasurerInfo(String startTime,String endTime,String companyType) throws Exception {
//
//        //获取钉钉token
//        token = getToken(companyType);
//
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//
//            List<String> approveIds = null;
//
//            Map<String, Object> approveIdsResult = null;
//            String processCode = "";
//            if("fc".equals(companyType)){
//                processCode = BANK_TREASURER_FC;
//                approveIdsResult = requestForApproveIdsFromEip(BANK_TREASURER_FC, cursor, startTime, endTime);
//
//            }
//
//
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                break;
//            }
//            // 每天新增审批
//            for (String approveId : approveIds) {
//                LOG.info("审批单号：[{}]" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String overTimeDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    Map<String,Object> resultMap = getBankTreasurerInfo(overTimeDetailResp,approveId,companyType);
//                    ApplyReimbursement applyReimbursement = (ApplyReimbursement)resultMap.get("applyReimbursement");
//                    if(applyReimbursement != null){
//                        ApplyReimbursementLog applyReimbursementLog = new ApplyReimbursementLog();
//                        BeanUtils.copyProperties(applyReimbursement,applyReimbursementLog);
//                        applyReimbursementLog.setProcessCode(processCode);
//                        applyReimbursementLogService.insert(applyReimbursementLog);
//                    }
//                }
//            }
//
//        }
//
//        LOG.info("============================富成借款单结束");
//    }
//
//    /**
//     *  借款单
//     * @param startTime
//     * @param endTime
//     * @param companyType
//     * @throws Exception
//     */
//    @Override
//    public void createBorrowInfo(String startTime,String endTime,String companyType) throws Exception {
//
//        //获取钉钉token
//        token = getToken(companyType);
//
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//
//            List<String> approveIds = null;
//
//            Map<String, Object> approveIdsResult = null;
//            String processCode = "";
//           if("fc".equals(companyType)){
//               processCode = BORROW_MONEY_FC;
//                approveIdsResult = requestForApproveIdsFromEip(BORROW_MONEY_FC, cursor, startTime, endTime);
//
//            }
//
//
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                break;
//            }
//            // 每天新增审批
//            for (String approveId : approveIds) {
//                LOG.info("审批单号：[{}]" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String overTimeDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    Map<String,Object> resultMap = getBorrowMonyBillForFc(overTimeDetailResp,approveId,companyType);
//                    ApplyReimbursement applyReimbursement = (ApplyReimbursement)resultMap.get("applyReimbursement");
//                    if(applyReimbursement != null){
//                        ApplyReimbursementLog applyReimbursementLog = new ApplyReimbursementLog();
//                        BeanUtils.copyProperties(applyReimbursement,applyReimbursementLog);
//                        applyReimbursementLog.setProcessCode(processCode);
//                        applyReimbursementLogService.insert(applyReimbursementLog);
//                    }
//                }
//            }
//
//        }
//
//        LOG.info("============================富成借款单结束");
//
//    }
//
//
//    public void createWord(List<ApplyReimbursement> applyReimbursementListForSend,String companyType) throws Exception {
//
//        token = getToken(companyType);
//
//        if(!CollectionUtils.isEmpty(applyReimbursementListForSend)){
//            for (ApplyReimbursement reimbursement:applyReimbursementListForSend){
//                LOG.info("发送单号【{}】",reimbursement.getApproveId());
//                SendDingdingMsgVo vo = new SendDingdingMsgVo();
//                vo.setCompanyName(reimbursement.getCompanyName());
//                vo.setExpenseDepartment(reimbursement.getExpenseDepartment());
//                vo.setApproveTime(DateUtil.formatDate(reimbursement.getApproveTime()));
//                vo.setApproveId(reimbursement.getApproveId());
//                vo.setPayee(reimbursement.getPayee());
//                vo.setAttachNum(reimbursement.getAttachNum()+"");
//                vo.setTotalAmountBig(reimbursement.getTotalAmountBig());
//                vo.setTotalAmount(reimbursement.getTotalAmount()+"");
//                vo.setApplyUser(isNull(reimbursement.getUserName()));
//                vo.setDocumentType(reimbursement.getDocumentType());
//
//                List<ApplyReimbursementDetail> details = applyReimbursementDetailService.selectList(new EntityWrapper<ApplyReimbursementDetail>().eq("approve_id",reimbursement.getApproveId()));
//                vo.setApplyReimbursementDetails(details);
//
//                //获取审批流信息
//
//                DdUserSyn ddUserSyn = ddUserSynService.selectOne(new EntityWrapper<DdUserSyn>().eq("user_id",reimbursement.getUserId()));
//
//                List<ApplyReimbursementProcess> processList = applyReimbursementProcessService.selectList(new EntityWrapper<ApplyReimbursementProcess>().eq("approve_id",reimbursement.getApproveId()));
//
//                if("57440735".equals(ddUserSyn.getDeptId())){
//                    String cwzgIndex = "";
//                    for(ApplyReimbursementProcess process:processList){
//                        if("财务主管".equals(process.getApproveUserPostition())){
//                            cwzgIndex = process.getAproveIndex();
//                        }
//                    }
//
//                    Iterator<ApplyReimbursementProcess> it = processList.iterator();
//                    while (it.hasNext()){
//
//                        ApplyReimbursementProcess process = it.next();
//                        if(Integer.parseInt(process.getAproveIndex())<Integer.parseInt(cwzgIndex)){
//                            it.remove();
//                        }
//                    }
//
//                    for(int i=0;i<processList.size();i++){
//                        ApplyReimbursementProcess process = processList.get(i);
//                        process.setAproveIndex((i+1)+"");
//                    }
//                }
//
//                if(!CollectionUtils.isEmpty(processList)){
//                    for (ApplyReimbursementProcess process:processList){
//
//                        if(StringUtils.isEmpty(process.getApproveUserPostition())){
//                            process.setApproveUserPostition(process.getApproveUserName());
//                        }
//
//                        if("全盘会计".equals(process.getApproveUserPostition())){
//                            process.setApproveUserPostition("财务");
//                        }
//
//                        int approveIndex = Integer.parseInt(process.getAproveIndex());
//                        switch (approveIndex){
//                            case 1:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveOne("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveOne("黄柳华");
//                                } else{
//                                    vo.setApproveOne(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveOneTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 2:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveTwo("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveTwo("黄柳华");
//                                }else {
//                                    vo.setApproveTwo(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveTwoTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 3:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveThree("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveThree("黄柳华");
//                                }else {
//                                    vo.setApproveThree(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveThreeTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 4:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveFour("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveFour("黄柳华");
//                                }else {
//                                    vo.setApproveFour(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveFourTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 5:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveFive("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveFive("黄柳华");
//                                }else {
//                                    vo.setApproveFive(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveFiveTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 6:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveSix("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveSix("黄柳华");
//                                }else {
//                                    vo.setApproveSix(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveSixTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 7:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveSeven("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveSeven("黄柳华");
//                                }else {
//                                    vo.setApproveSeven(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveSevenTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 8:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveEight("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveEight("黄柳华");
//                                }else {
//                                    vo.setApproveEight(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveEightTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                            case 9:
//                                if("总裁".equals(process.getApproveUserName())){
//                                    vo.setApproveNine("黄柳华");
//                                }else if("CEO".equals(process.getApproveUserName())){
//                                    vo.setApproveNine("黄柳华");
//                                }else {
//                                    vo.setApproveNine(isNull(process.getApproveUserName()));
//                                }
//                                vo.setApproveNineTitle(isNull(process.getApproveUserPostition()));
//                                break;
//                                default:
//                        }
//                    }
//
//                    String  fullFilePath = "";
//                    vo.setAttachNum("");
//                    if("ryx".equals(companyType)){
//
//                        vo.setApproveOne("");
//                        vo.setApproveTwo("");
//                        vo.setApproveThree("");
//                        vo.setApproveFour("");
//                        vo.setApproveFive("");
//
//                        vo.setApproveOneTitle("");
//                        vo.setApproveTwoTitle("");
//                        vo.setApproveThreeTitle("");
//                        vo.setApproveFourTitle("");
//                        vo.setApproveFiveTitle("");
//
//                        fullFilePath = wordAction.createWord(vo,4);
//                    }else {
//                        fullFilePath = wordAction.createWord(vo,processList.size());
//                    }
//                    DingTalkClient client_uploadFile = new DefaultDingTalkClient("https://oapi.dingtalk.com/media/upload");
//                    OapiMediaUploadRequest request = new OapiMediaUploadRequest();
//                    request.setType("file");
//                    request.setMedia(new FileItem(fullFilePath));
//                    OapiMediaUploadResponse response = client_uploadFile.execute(request,token);
//                    ApplyReimbursement applyReimbursement = new ApplyReimbursement();
//                    if(response.getErrcode()==0){
//
//                        applyReimbursement.setApproveId(reimbursement.getApproveId());
//                        applyReimbursement.setDataCode(response.getMediaId());
//
//                    }
//
//
//                    DingTalkClient client_sendFile = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
//
//                    OapiMessageCorpconversationAsyncsendV2Request request_sendFile = new OapiMessageCorpconversationAsyncsendV2Request();
//                    if("0".equals(isSend2TruePerson)){
//                        request_sendFile.setUseridList("01363156031159625984");
//                    }else {
//                        request_sendFile.setUseridList(reimbursement.getUserId());
//                    }
//                    long agentId = 0L;
//                    if("ryx".equals(companyType)){
//                        agentId = agentIdRyx;
//                    }else if("fc".equals(companyType)){
//                        agentId = agentIdFc;
//                    }
//                    request_sendFile.setAgentId(agentId);
//                    request_sendFile.setToAllUser(false);
//
//                    OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
//
//                    msg.setMsgtype("file");
//                    msg.setFile(new OapiMessageCorpconversationAsyncsendV2Request.File());
//                    msg.getFile().setMediaId(response.getMediaId());
//                    request_sendFile.setMsg(msg);
//
//                    OapiMessageCorpconversationAsyncsendV2Response response_sendFile = client_sendFile.execute(request_sendFile,token);
//                    if(response_sendFile.getErrcode()==0){
//                        applyReimbursement.setTaskId(response_sendFile.getTaskId()+"");
//                        applyReimbursement.setIsSend(1);
//                        applyReimbursementService.update(applyReimbursement,new EntityWrapper<ApplyReimbursement>().eq("approve_id",reimbursement.getApproveId()));
//                    }
//                }
//
//            }
//        }
//    }
//
//    private String isNull(String param){
//        return param==null?"":param;
//    }
//
//
//    @Override
//    public void synDDUserInfo(String companyType) {
//        LOG.info("======同步钉钉用户开始，同步主体【{}】",companyType);
//        ddUserSynService.delete(new EntityWrapper<DdUserSyn>().eq("extend1",companyType));
//        Map<String,Object> tokenReq = new HashMap<>();
//        tokenReq.put("companyType",companyType);
//        Result tokenResult = eipoutFeign.getDDTokenOther(tokenReq);
//        if("0000".equals(tokenResult.getReturnCode())){
//
//            Map<String,Object> resultMap = JsonUtil.json2Map(JsonUtil.obj2Str(tokenResult.getData()));
//            String token =  resultMap.get("accessToken")+"";
//            Map<String,Object> authDeptReq = new HashMap<>();
//            authDeptReq.put("token",token);
//            Result authDeptResult = eipoutFeign.getDDAuthDept(authDeptReq);
//            if("0000".equals(authDeptResult.getReturnCode())){
//                Map<String,Object> authDeptMap = JsonUtil.json2Map(JsonUtil.obj2Str(authDeptResult.getData()));
//                String authedDept =  authDeptMap.get("authedDept")+"";
//                Map<String,Object> ddDeptReq = new HashMap<>();
//                ddDeptReq.put("token",token);
//                ddDeptReq.put("authDept",authedDept);
//                Result ddDeptResult = eipoutFeign.getDDDept(ddDeptReq);
//                if("0000".equals(ddDeptResult.getReturnCode())){
//                    Map<String,Object> ddDeptMap = JsonUtil.json2Map(JsonUtil.obj2Str(ddDeptResult.getData()));
//                    Map<String,Object> topDept = new HashMap<>();
//                    topDept.put("id",authedDept);
//                    List<Map<String,Object>> departments = (List<Map<String,Object>>) ddDeptMap.get("department");
//                    departments.add(topDept);
//                    if(!CollectionUtils.isEmpty(departments)){
//                        for (Map<String,Object> map:departments){
//                            String deptId = map.get("id")+"";
//                            Map<String,Object> deptUserReq = new HashMap<>();
//                            deptUserReq.put("token",token);
//                            deptUserReq.put("departmentId",deptId);
//                            Result deptUserResult = eipoutFeign.getDDDeptUser(deptUserReq);
//                            if("0000".equals(deptUserResult.getReturnCode())){
//                                Map<String,Object> deptUSerMap = JsonUtil.json2Map(JsonUtil.obj2Str(deptUserResult.getData()));
//                                List<Map<String,Object>> userlist = (List<Map<String,Object>>) deptUSerMap.get("userlist");
//
//                                if(!CollectionUtils.isEmpty(userlist)){
//                                    for (Map<String,Object> userMap:userlist){
//                                        DdUserSyn ddUser = new DdUserSyn();
//
//                                        ddUser.setUserId(userMap.get("userid")+"");
//                                        ddUser.setUserName(userMap.get("name")+"");
//                                        ddUser.setDeptId(deptId);
//                                        ddUser.setMobile(userMap.get("mobile")+"");
//                                        ddUser.setJobNumber(userMap.get("jobnumber")+"");
//                                        ddUser.setPosition(userMap.get("position")+"");
//                                        ddUser.setCreateDatetime(DateUtil.getNow());
//                                        ddUser.setExtend1(companyType);
//                                        ddUserSynService.insert(ddUser);
//                                    }
//                                }
//                            }
//                        }
//                    }
//                }
//            }
//        }
//        LOG.info("======同步钉钉用户结束");
//    }
//
//    @Override
//    public void sendApproveBill(String companyType) {
//
//        // 更新审批不通过的单的审批状态
////        List<ApplyReimbursement> applyReimbursements = applyReimbursementService.selectList(new EntityWrapper<ApplyReimbursement>().eq("approve_status","0"));
////        if(!CollectionUtils.isEmpty(applyReimbursements)){
////            for (ApplyReimbursement applyReimbursement : applyReimbursements){
////                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(applyReimbursement.getProcessId());
////                if (approvesDetails != null) {
////                    String overTimeDetailResp = approvesDetails.get("approveDetailResp") + "";
////                    // 此处需参考回调发送方式，区分不同的流程类型，调用不同的内容处理方法，有需要在做修改
////                    Map<String, Object> resultMap = getExpenseAccountForRyx(overTimeDetailResp, applyReimbursement.getApproveId(),companyType);
////                    ApplyReimbursement applyReimbursementNew = (ApplyReimbursement) resultMap.get("applyReimbursement");
////                    List<ApplyReimbursementProcess> applyReimbursementProcessListNew = (List<ApplyReimbursementProcess>)resultMap.get("applyReimbursementProcessList");
////                    if(applyReimbursementNew != null && applyReimbursementNew.getApproveStatus() == 1){
////                        applyReimbursement.setApproveStatus(1);
////                        applyReimbursement.setUpdateTime(DateUtil.getNow());
////                        applyReimbursementService.update(applyReimbursement,new EntityWrapper<ApplyReimbursement>().eq("approve_id",applyReimbursement.getApproveId()));
////                        applyReimbursementProcessService.delete(new EntityWrapper<ApplyReimbursementProcess>().eq("approve_id",applyReimbursement.getApproveId()));
////                        applyReimbursementProcessService.insertBatch(applyReimbursementProcessListNew);
////                    }
////                }
////            }
////        }
//
//        // 更新名称和职位信息
//        applyReimbursementService.updateUserName();
//        applyReimbursementProcessService.updateUserNameAndPosition();
//        // 找所有审批通过 未发送的单，发送
//        List<ApplyReimbursement> applyReimbursementListForSend = applyReimbursementService.selectList(new EntityWrapper<ApplyReimbursement>().eq("approve_status","1").eq("is_send","0").eq("company_type",companyType));
//        try {
//            createWord(applyReimbursementListForSend,companyType);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//
//
//    }
//
//    @Override
//    public void synDDVocationData(String startTime,String endTime,String companyType) throws Exception {
//        this.token = getToken(companyType);
//
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//            List<String> approveIds = null;
//
//            String processId = "";
//            if("ht".equals(companyType)){
//                processId = VOCATION_APPLICATION;
//            }else if("fc".equals(companyType)){
//                processId = VOCATION_APPLICATION_FC;
//            }
//
//            Map<String, Object> approveIdsResult = requestForApproveIdsFromEip(processId, cursor, startTime, endTime);
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                break;
//            }
//            for (String approveId : approveIds) {
//                LOG.info("请假审批单号：[{}]" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String overTimeDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    VocationApprove vocationApprove = getVocationApproveDetail(overTimeDetailResp,approveId);
//                    if(vocationApprove!=null){
//                        vocationApprove.setCreateTime(DateUtil.getNow());
//                        vocationApprove.setCompanyType(companyType);
//                        vocationApproveService.insert(vocationApprove);
//                    }
//
//                }
//            }
//        }
//
//    }
//
//    public void updateOverTimeHours(String overTimeDate) {
//
//        Wrapper<OverTimeDetail> wrapper = new EntityWrapper<OverTimeDetail>();
//        wrapper.ge("over_time_date", getFirstDayOfMonth(overTimeDate));
//        wrapper.le("over_time_date", getLastDayOfMonth(overTimeDate));
//        List<OverTimeDetail> overTimeDetails = overTimeDetailService.selectList(wrapper);
//
//
//        //获取法定节假日
//        String year = DateUtil.formatDate("yyyy", DateUtil.getDate(overTimeDate,"yyyy-MM"));
//        holidays = holidayService.selectList(new EntityWrapper<Holiday>().eq("date_year", year));
//        for (OverTimeDetail overTimeDetail : overTimeDetails) {
//
//            BigDecimal overTimeHouers = getOverTimeHours(overTimeDetail,holidays);
//            if(overTimeHouers != null && overTimeHouers.compareTo(new BigDecimal(0))==-1){
//                overTimeHouers = new BigDecimal(0);
//            }
//            if(isTriple(overTimeDetail.getOverTimeDate(),holidays)){
//                overTimeDetail.setIsTriple(1);
//            }else {
//                overTimeDetail.setIsTriple(0);
//            }
//            overTimeDetail.setOverTimeHours(handingTimeO25(overTimeHouers));
//            overTimeDetailService.update(overTimeDetail, new EntityWrapper<OverTimeDetail>().eq("user_id", overTimeDetail.getUserId()).eq("over_time_date", overTimeDetail.getOverTimeDate()).eq("over_time_approve_id",overTimeDetail.getOverTimeApproveId()).eq("company_type",this.companyType));
//            UserVocationHours userVocationHour = userVocationHoursService.selectOne(new EntityWrapper<UserVocationHours>().eq("user_id",overTimeDetail.getUserId()));
//
//            if(userVocationHour != null){
//                String hours = new BigDecimal(userVocationHour.getRemainHours()).add(overTimeDetail.getOverTimeHours()).toString();
//                userVocationHour.setRemainHours(hours);
//                userVocationHoursService.updateById(userVocationHour);
//            }else {
//                userVocationHour = new UserVocationHours();
//                userVocationHour.setRemainHours(overTimeDetail.getOverTimeHours()==null?"0":overTimeDetail.getOverTimeHours().toString());
//                userVocationHour.setCompanyType(this.companyType);
//                userVocationHour.setCreateTime(DateUtil.getNow());
//                userVocationHour.setUserId(overTimeDetail.getUserId());
//                userVocationHour.setUserName(overTimeDetail.getUserName());
//                userVocationHoursService.insert(userVocationHour);
//            }
//        }
//    }
//
//    private Map<String, Object> requestForApproveIdsFromEip(String processId, Integer cursor, String startDate, String endDate) {
//        Map<String, Object> result = new HashMap<>();
//        Map<String, Object> overTimeListreq = new HashMap<>();
//        overTimeListreq.put("token", token);
//        overTimeListreq.put("process_code", processId);
//        overTimeListreq.put("start_time", DateUtil.getDate(startDate, "yyyy-MM-dd HH:mm:ss").getTime());
//        overTimeListreq.put("end_time", DateUtil.getDate(endDate, "yyyy-MM-dd HH:mm:ss").getTime());
//        overTimeListreq.put("cursor", cursor);
//        Result overTimeListResult = eipoutFeign.getOverTimeList(overTimeListreq);
//        if ("0000".equals(overTimeListResult.getReturnCode())) {
//
//            String overTimeListResp = JSONObject.toJSONString(overTimeListResult.getData());
//            String approveIdsStr = JSONPath.read(overTimeListResp, "$.result.list").toString();
//            if (JSONPath.contains(overTimeListResult.getData(), "$.result.next_cursor")) {
//                String next_cursor = JSONPath.read(overTimeListResp, "$.result.next_cursor").toString();
//                cursor = Integer.parseInt(next_cursor);
//            } else {
//                cursor = null;
//            }
//            result.put("approveIdsStr", approveIdsStr);
//            result.put("cursor", cursor);
//            return result;
//        }
//        return null;
//    }
//
//    private Map<String, Object> requestForApproveDetailsFromEip(String approveIds) {
//        Map<String, Object> result = new HashMap<>();
//        Map<String, Object> overTimeDetailreq = new HashMap<>();
//        overTimeDetailreq.put("process_instance_id", approveIds);
//        overTimeDetailreq.put("token", token);
//        Result eipResult = eipoutFeign.getOverTimeDetail(overTimeDetailreq);
//        if ("0000".equals(eipResult.getReturnCode())) {
//            String overTimeDetailResp = JSONObject.toJSONString(eipResult.getData());
//            result.put("approveDetailResp", overTimeDetailResp);
//            return result;
//        }
//        return null;
//    }
//
//    private Map<String, Object> requestForOverTimeFromEip(OverTimeDetail overTimeDetail) {
//        Map<String, Object> result = new HashMap<>();
//        List<String> userIdList = new ArrayList<>();
//        userIdList.add(overTimeDetail.getUserId());
//        Map<String, Object> kqReq = new HashMap<>();
//        kqReq.put("workDateFrom", DateUtil.formatDate("yyyy-MM-dd", overTimeDetail.getOverTimeDate()) + " 00:00:00");
//        kqReq.put("workDateTo", DateUtil.formatDate("yyyy-MM-dd", overTimeDetail.getOverTimeDate()) + " 23:59:59");
//        kqReq.put("userIdList", userIdList);
//        kqReq.put("offset", 0);
//        kqReq.put("limit", 2);
//        kqReq.put("token", token);
//        Result kqResult = eipoutFeign.getKqDetail(kqReq);
//        if ("0000".equals(kqResult.getReturnCode())) {
//            String kqResp = JSONObject.toJSONString(kqResult.getData());
//            result.put("kqResp", kqResp);
//            return result;
//        }
//        return null;
//    }
//
//    private void getKqDetail(OverTimeDetail overTimeDetail, String kqResp) {
//
//        String json = kqResp;
//
//        List<KqDetail> kqDetails = JSONArray.parseArray(JSONPath.read(json, "$.recordresult").toString(), KqDetail.class);
//        if (!CollectionUtils.isEmpty(kqDetails)) {
//            for (KqDetail kqDetail : kqDetails) {
//                if (kqDetail.getUserId().equals(overTimeDetail.getUserId()) && "OnDuty".equals(kqDetail.getCheckType()) && !"NotSigned".equals(kqDetail.getTimeResult())) {
//                    overTimeDetail.setActualStartTime(DateUtil.transToDate(kqDetail.getUserCheckTime()));
//                }
//                if (kqDetail.getUserId().equals(overTimeDetail.getUserId()) && "OffDuty".equals(kqDetail.getCheckType()) && !"NotSigned".equals(kqDetail.getTimeResult())) {
//                    overTimeDetail.setActualEndTime(DateUtil.transToDate(kqDetail.getUserCheckTime()));
//                }
//            }
//        }
//    }
//
//    public BigDecimal getOverTimeHours(OverTimeDetail overTimeDetail,List<Holiday> holidays) {
//
//
//        //计算加班时长
//        Date startTime = null;
//        Date endTime = null;
//
//        BigDecimal overTimeHouers = new BigDecimal(0);
//
//        String compareDate = DateUtil.formatDate(overTimeDetail.getApproveStartTime());
//
//        if (overTimeDetail.getActualStartTime() == null) {
//            overTimeDetail.setActualStartTime(overTimeDetail.getGoOutStarTime());
//
//            if(overTimeDetail.getOnBusinessStartTime() != null){
//                // 有出差申请，以加班申请时间为准
//                overTimeDetail.setActualStartTime(overTimeDetail.getApproveStartTime());
//            }
//        }
//
//        if(overTimeDetail.getActualEndTime() == null){
//            overTimeDetail.setActualEndTime(overTimeDetail.getGoOutEndTime() );
//            if(overTimeDetail.getOnBusinessStartTime() != null){
//                // 有出差申请，以加班申请时间为准
//                overTimeDetail.setActualEndTime(overTimeDetail.getApproveEndTime());
//            }
//        }
//
//        startTime = DateUtil.dateCompare(overTimeDetail.getApproveStartTime(), overTimeDetail.getActualStartTime()) == -1 ? overTimeDetail.getActualStartTime() : overTimeDetail.getApproveStartTime();
//        endTime = DateUtil.dateCompare(overTimeDetail.getApproveEndTime(), overTimeDetail.getActualEndTime()) == -1 ? overTimeDetail.getApproveEndTime() : overTimeDetail.getActualEndTime();
//
//        if (startTime == null || endTime == null) {
//            return new BigDecimal(0);
//        }
//
//        Long difHours = 0L;
//        Integer difDay = DateUtil.getDiffDays(DateUtil.getDate(DateUtil.formatDate(startTime)), DateUtil.getDate(DateUtil.formatDate(endTime)));
//        boolean isOverDay = false;
//        if (difDay > 0) {
//            isOverDay = true;
//            // 跨天，结束时间先算到第二天零点，多出的加班时间，在补上
//            Date oriEndTime = endTime;
//            endTime = DateUtil.getDate(DateUtil.formatDate(startTime) + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
//            difHours = DateUtil.getDiffSeconds(endTime,oriEndTime);
//        }
//
//        if (!isHoliday(DateUtil.getDate(compareDate), holidays)) {
////            DateUtil.
//            Long difSecond = DateUtil.getDiffSeconds(DateUtil.getDate(compareDate + " 19:30:00", "yyyy-MM-dd HH:mm:ss"), endTime);
//            if (isOverDay) {
//                difSecond = difSecond + difHours - 1;
//            }
//            overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP);
//            return overTimeHouers;
//        }
//
//        if (DateUtil.dateCompare(endTime, DateUtil.getDate(compareDate + " 12:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            // 结束时间未超过12点
//
//            Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), endTime);
//            if (isOverDay) {
//                difSecond = difSecond + difHours - 1;
//            }
//            overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP);
//
//        } else if (DateUtil.dateCompare(endTime, DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            // 结束时间未超过13:30
//            if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 12:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 12:00:00", "yyyy-MM-dd HH:mm:ss"));
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP);
//            }
//
//        } else if (DateUtil.dateCompare(endTime, DateUtil.getDate(compareDate + " 18:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            // 结束时间未超过18:00
//
//            if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 12:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), endTime);
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(1.5));
//            } else if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), endTime);
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                BigDecimal subTime = new BigDecimal(DateUtil.getDiffSeconds(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss")));
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP).subtract(subTime);
//            } else {
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), endTime);
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP);
//            }
//
//
//        } else if (DateUtil.dateCompare(endTime, DateUtil.getDate(compareDate + " 19:30:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            // 结束时间未超过19:30
//            if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 12:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 18:00:00", "yyyy-MM-dd HH:mm:ss"));
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(1.5));
//            } else if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 18:00:00", "yyyy-MM-dd HH:mm:ss"));
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                BigDecimal subTime = new BigDecimal(DateUtil.getDiffSeconds(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss")));
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP).subtract(subTime);
//
//            } else if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 18:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 18:00:00", "yyyy-MM-dd HH:mm:ss"));
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP);
//            }
//
//        } else {
//            // 结束时间超过19:30
//
//            if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 12:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), endTime);
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(3));
//            } else if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//
//                Long difSecond = DateUtil.getDiffSeconds(DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss"), endTime);
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(1.5));
//
//            } else if (DateUtil.dateCompare(judgeStartTime(startTime), DateUtil.getDate(compareDate + " 18:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), endTime);
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(1.5));
//            } else {
//                Long difSecond = DateUtil.getDiffSeconds(judgeStartTime(startTime), endTime);
//                if (isOverDay) {
//                    difSecond = difSecond + difHours - 1;
//                }
//                overTimeHouers = new BigDecimal(difSecond).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_HALF_UP);
//            }
//        }
//        return overTimeHouers;
//    }
//
//    private static Map<String,Object> getBankTreasurerInfo(String resp,String approveId,String companyType){
//
//        Map<String,Object> resultMap = new HashMap<>();
//
//        String json = resp;
//        String approveResult = JSONPath.read(json, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(json, "$.process_instance.status").toString();
//
//        //流程结束，审批通过
//        JSONArray array = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.form_component_values").toString());
//        Date applyTime = DateUtil.getDate(JSONPath.read(json, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//        String businessId = JSONPath.read(json, "$.process_instance.business_id").toString();
//        String userId = JSONPath.read(json, "$.process_instance.originator_userid").toString();
//        ApplyReimbursement applyReimbursement = new ApplyReimbursement();
//        applyReimbursement.setApproveId(businessId);
//        applyReimbursement.setProcessId(approveId);
//        applyReimbursement.setUserId(userId);
//        applyReimbursement.setApproveTime(applyTime);
//        applyReimbursement.setCompanyType(companyType);
//        applyReimbursement.setDocumentType("资金调拨单");
//        applyReimbursement.setExpenseDepartment("财务中心");
//        String payType = "";
//        if(array != null){
//            for(Object obj:array){
//                Map<String,Object> item = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//
//                if("付款公司".equals(item.get("name")+"")){
//
//                    applyReimbursement.setCompanyName(item.get("value")+"");
//                }
//
//                if("收款单位".equals(item.get("name")+"")){
//
//                    applyReimbursement.setPayee(item.get("value")+"");
//                }
//
//                if("付款方式".equals(item.get("name")+"")){
//                    payType = item.get("value")+"";
//                }
//                if("附件".equals(item.get("name")+"")){
//                    JSONArray attachArray = JSONArray.parseArray(item.get("value")+"");
//                    applyReimbursement.setAttachNum(attachArray==null?0:attachArray.size());
//                }
//
//                if("付款总额".equals(item.get("name")+"")){
//                    applyReimbursement.setTotalAmount(item.get("value")+"".trim());
//                    Map<String,Object> amountJson = JsonUtil.json2Map(item.get("ext_value")+"");
//                    applyReimbursement.setTotalAmountBig(amountJson.get("upper")+"");
//                }
//
//                if("明细".equals(item.get("name")+"")){
//                    JSONArray detailArray = JSONArray.parseArray(item.get("value")+"");
//                    List<ApplyReimbursementDetail> applyReimbursementDetails = new ArrayList<>();
//                    if(detailArray != null){
//
//                        for (int i=0;i<detailArray.size();i++){
//                            Object detail =detailArray.get(i);
//                            ApplyReimbursementDetail applyReimbursementDetail = new ApplyReimbursementDetail();
//                            Map<String,Object> detailMap = JsonUtil.json2Map(JsonUtil.obj2Str(detail));
//                            List<Object> mapList = JsonUtil.json2List(JsonUtil.obj2Str(detailMap.get("rowValue")),Object.class);
//                            if(!CollectionUtils.isEmpty(mapList)){
//                                for(Object detailItem:mapList){
//                                    Map<String,Object> itemMap = JsonUtil.json2Map(JsonUtil.obj2Str(detailItem));
//                                    if("付款总额".equals(itemMap.get("label")+"")){
//                                        if(itemMap.get("value") != null){
//                                            applyReimbursementDetail.setAmount(itemMap.get("value")+"".trim());
//                                        }
//
//                                    }
//
//                                    if("付款类别".equals(itemMap.get("label")+"")){
//                                        applyReimbursementDetail.setFeeName(itemMap.get("value")+"");
//                                    }
//
//                                }
//                                applyReimbursementDetail.setApproveId(businessId);
//                                applyReimbursementDetail.setCreateTime(DateUtil.getNow());
//                                applyReimbursementDetail.setAbstractNote(applyReimbursementDetail.getFeeName());
//                                applyReimbursementDetail.setIndex((i+1)+"");
//                                applyReimbursementDetails.add(applyReimbursementDetail);
//                            }
//
//
//                        }
//                    }
//                    resultMap.put("applyReimbursementDetails",applyReimbursementDetails);
//                }
//
//                resultMap.put("payType",payType);
//            }
//        }
//
//        List<ApplyReimbursementProcess> applyReimbursementProcessList = new ArrayList<>();
//        JSONArray taskArray = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.tasks").toString());
//        if(taskArray != null){
//            for(int i=1;i<=taskArray.size();i++){
//                Object taskItem = taskArray.get(i-1);
//                Map<String,Object> taskMap = JsonUtil.json2Map(JsonUtil.obj2Str(taskItem));
//                ApplyReimbursementProcess applyReimbursementProcess = new ApplyReimbursementProcess();
//                applyReimbursementProcess.setApproveId(businessId);
//                if(taskMap.get("create_time") != null){
//                    applyReimbursementProcess.setApproveTime(DateUtil.getDateTime(taskMap.get("create_time")+""));
//                }
//                applyReimbursementProcess.setApproveUserId(taskMap.get("userid")+"");
////                applyReimbursementProcess.setAproveIndex(i+"");
//                applyReimbursementProcess.setCreateTime(taskMap.get("finish_time") == null?null:DateUtil.getDateTime(taskMap.get("finish_time")+""));
//                applyReimbursementProcessList.add(applyReimbursementProcess);
//            }
//            Collections.sort(applyReimbursementProcessList);
//            Iterator<ApplyReimbursementProcess> it = applyReimbursementProcessList.iterator();
//
//            for(int i=0;i<applyReimbursementProcessList.size();i++){
//                ApplyReimbursementProcess process = applyReimbursementProcessList.get(i);
//                process.setAproveIndex((i+1)+"");
//            }
//        }
//
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            applyReimbursement.setApproveStatus(1);
//        }
//
//        resultMap.put("applyReimbursementProcessList",applyReimbursementProcessList);
//        resultMap.put("applyReimbursement",applyReimbursement);
//
//
//        return resultMap;
//
//    }
//
//    /**
//     * 富成法务费
//     * @param resp
//     * @param approveId
//     * @param companyType
//     * @return
//     */
//    private static Map<String,Object> getLawFeeBillForFc(String resp,String approveId,String companyType){
//
//        Map<String,Object> resultMap = new HashMap<>();
//
//        String json = resp;
//        String approveResult = JSONPath.read(json, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(json, "$.process_instance.status").toString();
//
//        //流程结束，审批通过
//        JSONArray array = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.form_component_values").toString());
//        Date applyTime = DateUtil.getDate(JSONPath.read(json, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//        String businessId = JSONPath.read(json, "$.process_instance.business_id").toString();
//        String userId = JSONPath.read(json, "$.process_instance.originator_userid").toString();
//        ApplyReimbursement applyReimbursement = new ApplyReimbursement();
//        applyReimbursement.setApproveId(businessId);
//        applyReimbursement.setProcessId(approveId);
//        applyReimbursement.setUserId(userId);
//        applyReimbursement.setApproveTime(applyTime);
//        applyReimbursement.setCompanyType(companyType);
//        applyReimbursement.setCompanyName("深圳市富诚资产管理有限公司");
//        String payType = "";
//        String feeName = "";
//        if(array != null){
//            for(Object obj:array){
//                Map<String,Object> item = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                if("报销部门".equals(item.get("name")+"")){
//
//                    applyReimbursement.setExpenseDepartment(item.get("value")+"");
//                }
//
//                if("报销类型".equals(item.get("name")+"")){
//
//                    applyReimbursement.setDocumentType(item.get("value")+"");
//                }
//
//                if("付款类别".equals(item.get("name")+"")){
//
//                    feeName = item.get("value")+"";
//                }
//
//                if("付款方式".equals(item.get("name")+"")){
//                    payType = item.get("value")+"";
//                }
//                if("附件".equals(item.get("name")+"")){
//                    JSONArray attachArray = JSONArray.parseArray(item.get("value")+"");
//                    applyReimbursement.setAttachNum(attachArray==null?0:attachArray.size());
//                }
//
//                if("合计金额".equals(item.get("name")+"")){
//                    applyReimbursement.setTotalAmount(item.get("value")+"".trim());
//                    Map<String,Object> amountJson = JsonUtil.json2Map(item.get("ext_value")+"");
//                    applyReimbursement.setTotalAmountBig(amountJson.get("upper")+"");
//                }
//
//                if("明细".equals(item.get("name")+"")){
//                    JSONArray detailArray = JSONArray.parseArray(item.get("value")+"");
//                    List<ApplyReimbursementDetail> applyReimbursementDetails = new ArrayList<>();
//                    if(detailArray != null){
//
//                        for (int i=0;i<detailArray.size();i++){
//                            Object detail =detailArray.get(i);
//                            ApplyReimbursementDetail applyReimbursementDetail = new ApplyReimbursementDetail();
//                            Map<String,Object> detailMap = JsonUtil.json2Map(JsonUtil.obj2Str(detail));
//                            List<Object> mapList = JsonUtil.json2List(JsonUtil.obj2Str(detailMap.get("rowValue")),Object.class);
//                            if(!CollectionUtils.isEmpty(mapList)){
//                                for(Object detailItem:mapList){
//                                    Map<String,Object> itemMap = JsonUtil.json2Map(JsonUtil.obj2Str(detailItem));
//                                    if("付款金额".equals(itemMap.get("label")+"")){
//                                        if(itemMap.get("value") != null){
//                                            applyReimbursementDetail.setAmount(itemMap.get("value")+"".trim());
//                                        }
//
//                                    }
//                                    if("收款单位".equals(itemMap.get("label")+"")){
//                                        applyReimbursement.setPayee(itemMap.get("value")+"");
//                                    }
//                                }
//                                applyReimbursementDetail.setFeeName(feeName);
//                                applyReimbursementDetail.setApproveId(businessId);
//                                applyReimbursementDetail.setCreateTime(DateUtil.getNow());
//                                applyReimbursementDetail.setAbstractNote(applyReimbursementDetail.getFeeName());
//                                applyReimbursementDetail.setIndex((i+1)+"");
//                                applyReimbursementDetails.add(applyReimbursementDetail);
//                            }
//
//
//                        }
//                    }
//                    resultMap.put("applyReimbursementDetails",applyReimbursementDetails);
//                }
//
//                resultMap.put("payType",payType);
//            }
//        }
//
//        List<ApplyReimbursementProcess> applyReimbursementProcessList = new ArrayList<>();
//        JSONArray taskArray = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.tasks").toString());
//        if(taskArray != null){
//            for(int i=1;i<=taskArray.size();i++){
//                Object taskItem = taskArray.get(i-1);
//                Map<String,Object> taskMap = JsonUtil.json2Map(JsonUtil.obj2Str(taskItem));
//                ApplyReimbursementProcess applyReimbursementProcess = new ApplyReimbursementProcess();
//                applyReimbursementProcess.setApproveId(businessId);
//                if(taskMap.get("create_time") != null){
//                    applyReimbursementProcess.setApproveTime(DateUtil.getDateTime(taskMap.get("create_time")+""));
//                }
//                applyReimbursementProcess.setApproveUserId(taskMap.get("userid")+"");
////                applyReimbursementProcess.setAproveIndex(i+"");
//                applyReimbursementProcess.setCreateTime(taskMap.get("finish_time") == null?null:DateUtil.getDateTime(taskMap.get("finish_time")+""));
//                applyReimbursementProcessList.add(applyReimbursementProcess);
//            }
//            Collections.sort(applyReimbursementProcessList);
//            Iterator<ApplyReimbursementProcess> it = applyReimbursementProcessList.iterator();
//
//            for(int i=0;i<applyReimbursementProcessList.size();i++){
//                ApplyReimbursementProcess process = applyReimbursementProcessList.get(i);
//                process.setAproveIndex((i+1)+"");
//            }
//        }
//
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            applyReimbursement.setApproveStatus(1);
//        }
//
//        resultMap.put("applyReimbursementProcessList",applyReimbursementProcessList);
//        resultMap.put("applyReimbursement",applyReimbursement);
//
//
//        return resultMap;
//
//
//    }
//
//    private static Map<String,Object> getBorrowMonyBillForFc(String resp,String approveId,String companyType){
//        Map<String,Object> resultMap = new HashMap<>();
//
//        String json = resp;
//        String approveResult = JSONPath.read(json, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(json, "$.process_instance.status").toString();
//
//        //流程结束，审批通过
//        JSONArray array = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.form_component_values").toString());
//        Date applyTime = DateUtil.getDate(JSONPath.read(json, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//        String businessId = JSONPath.read(json, "$.process_instance.business_id").toString();
//        String userId = JSONPath.read(json, "$.process_instance.originator_userid").toString();
//        ApplyReimbursement applyReimbursement = new ApplyReimbursement();
//        applyReimbursement.setApproveId(businessId);
//        applyReimbursement.setProcessId(approveId);
//        applyReimbursement.setUserId(userId);
//        applyReimbursement.setApproveTime(applyTime);
//        applyReimbursement.setCompanyType(companyType);
//        applyReimbursement.setDocumentType("借款单");
//        String borrowType = "";
//        String borrowmoney = "";
//        if(array != null){
//            for(Object obj:array){
//                Map<String,Object> item = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                if("公司".equals(item.get("name")+"")){
//                    applyReimbursement.setCompanyName(item.get("value")+"");
//                }
//                if("借款中心".equals(item.get("name")+"")){
//
//                    applyReimbursement.setExpenseDepartment(item.get("value")+"");
//                }
//
//                if("借款人".equals(item.get("name")+"")){
//                    applyReimbursement.setPayee(item.get("value")+"");
//                }
//                if("附件".equals(item.get("name")+"")){
//                    JSONArray attachArray = JSONArray.parseArray(item.get("value")+"");
//                    applyReimbursement.setAttachNum(attachArray==null?0:attachArray.size());
//                }
//
//                if("金额（元）".equals(item.get("name")+"")){
//                    applyReimbursement.setTotalAmount(item.get("value")+"".trim());
//                    Map<String,Object> amountJson = JsonUtil.json2Map(item.get("ext_value")+"");
//                    applyReimbursement.setTotalAmountBig(amountJson.get("upper")+"");
//                }
//
//                if("借款种类".equals(item.get("name")+"")){
//                    borrowType = item.get("value")+"";
//                }
//
//                if("金额（元）".equals(item.get("name")+"")){
//                    borrowmoney = item.get("value")+"".trim();
//
//                }
//
//                resultMap.put("payType","转账");
//            }
//
//
//            List<ApplyReimbursementDetail> applyReimbursementDetails = new ArrayList<>();
//            ApplyReimbursementDetail applyReimbursementDetail = new ApplyReimbursementDetail();
//
//            applyReimbursementDetail.setApproveId(businessId);
//            applyReimbursementDetail.setCreateTime(DateUtil.getNow());
//            applyReimbursementDetail.setIndex("1");
//            applyReimbursementDetail.setPayType("转账");
//            applyReimbursementDetail.setAbstractNote("员工借款");
//            applyReimbursementDetail.setAmount(borrowmoney);
//            applyReimbursementDetail.setFeeName(borrowType);
//            applyReimbursementDetails.add(applyReimbursementDetail);
//
//            resultMap.put("applyReimbursementDetails",applyReimbursementDetails);
//
//        }
//
//        List<ApplyReimbursementProcess> applyReimbursementProcessList = new ArrayList<>();
//        JSONArray taskArray = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.tasks").toString());
//        if(taskArray != null){
//            for(int i=1;i<=taskArray.size();i++){
//                Object taskItem = taskArray.get(i-1);
//                Map<String,Object> taskMap = JsonUtil.json2Map(JsonUtil.obj2Str(taskItem));
//                ApplyReimbursementProcess applyReimbursementProcess = new ApplyReimbursementProcess();
//                applyReimbursementProcess.setApproveId(businessId);
//                if(taskMap.get("create_time") != null){
//                    applyReimbursementProcess.setApproveTime(DateUtil.getDateTime(taskMap.get("create_time")+""));
//                }
//                applyReimbursementProcess.setApproveUserId(taskMap.get("userid")+"");
////                applyReimbursementProcess.setAproveIndex(i+"");
//                applyReimbursementProcess.setCreateTime(taskMap.get("finish_time") == null?null:DateUtil.getDateTime(taskMap.get("finish_time")+""));
//                applyReimbursementProcessList.add(applyReimbursementProcess);
//            }
//            Collections.sort(applyReimbursementProcessList);
//            Iterator<ApplyReimbursementProcess> it = applyReimbursementProcessList.iterator();
//
//            for(int i=0;i<applyReimbursementProcessList.size();i++){
//                ApplyReimbursementProcess process = applyReimbursementProcessList.get(i);
//                process.setAproveIndex((i+1)+"");
//            }
//        }
//
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            applyReimbursement.setApproveStatus(1);
//        }
//
//        resultMap.put("applyReimbursementProcessList",applyReimbursementProcessList);
//        resultMap.put("applyReimbursement",applyReimbursement);
//
//
//        return resultMap;
//    }
//
//    private static Map<String,Object> getExpenseAccountForRyx(String resp,String approveId,String companyType){
//
//        Map<String,Object> resultMap = new HashMap<>();
//
//        String json = resp;
//        String approveResult = JSONPath.read(json, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(json, "$.process_instance.status").toString();
//
//        //流程结束，审批通过
//        JSONArray array = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.form_component_values").toString());
//        Date applyTime = DateUtil.getDate(JSONPath.read(json, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//        String businessId = JSONPath.read(json, "$.process_instance.business_id").toString();
//        String userId = JSONPath.read(json, "$.process_instance.originator_userid").toString();
//        ApplyReimbursement applyReimbursement = new ApplyReimbursement();
//        applyReimbursement.setApproveId(businessId);
//        applyReimbursement.setProcessId(approveId);
//        applyReimbursement.setUserId(userId);
//        applyReimbursement.setApproveTime(applyTime);
//        applyReimbursement.setCompanyType(companyType);
//        applyReimbursement.setDocumentType("费用报销单");
//        String payType = "";
//        if(array != null){
//            for(Object obj:array){
//                Map<String,Object> item = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                if("报销公司".equals(item.get("name")+"")){
//                    applyReimbursement.setCompanyName(item.get("value")+"");
//                }
//                if("ryx".equals(companyType)){
//                    if("报销部门".equals(item.get("name")+"")){
//
//                        applyReimbursement.setExpenseDepartment(item.get("value")+"");
//                    }
//                }else if("fc".equals(companyType)){
//                    if("费用归属中心".equals(item.get("name")+"")){
//                        applyReimbursement.setExpenseDepartment(item.get("value")+"");
//                    }
//                }
//
//                if("收款单位".equals(item.get("name")+"")){
//                    applyReimbursement.setPayee(item.get("value")+"");
//                }
//                if("付款方式".equals(item.get("name")+"")){
//                    payType = item.get("value")+"";
//                }
//                if("附件".equals(item.get("name")+"")){
//                    JSONArray attachArray = JSONArray.parseArray(item.get("value")+"");
//                    applyReimbursement.setAttachNum(attachArray==null?0:attachArray.size());
//                }
//                if("fc".equals(companyType)){
//
//                    if("合计金额".equals(item.get("name")+"")){
//                        applyReimbursement.setTotalAmount(item.get("value")+"".trim());
//                        Map<String,Object> amountJson = JsonUtil.json2Map(item.get("ext_value")+"");
//                        applyReimbursement.setTotalAmountBig(amountJson.get("upper")+"");
//                    }
//
//                }else if("ryx".equals(companyType)){
//                    if("付款总额(元)".equals(item.get("name")+"")){
//                        applyReimbursement.setTotalAmount(item.get("value")+"".trim());
//                        Map<String,Object> amountJson = JsonUtil.json2Map(item.get("ext_value")+"");
//                        applyReimbursement.setTotalAmountBig(amountJson.get("upper")+"");
//                    }
//                }
//
//                if("fc".equals(companyType)){
//
//                    if("明细".equals(item.get("name")+"")){
//                        JSONArray detailArray = JSONArray.parseArray(item.get("value")+"");
//                        List<ApplyReimbursementDetail> applyReimbursementDetails = new ArrayList<>();
//                        if(detailArray != null){
//
//                            for (int i=0;i<detailArray.size();i++){
//                                Object detail =detailArray.get(i);
//                                ApplyReimbursementDetail applyReimbursementDetail = new ApplyReimbursementDetail();
//                                Map<String,Object> detailMap = JsonUtil.json2Map(JsonUtil.obj2Str(detail));
//                                List<Object> mapList = JsonUtil.json2List(JsonUtil.obj2Str(detailMap.get("rowValue")),Object.class);
//                                if(!CollectionUtils.isEmpty(mapList)){
//                                    for(Object detailItem:mapList){
//                                        Map<String,Object> itemMap = JsonUtil.json2Map(JsonUtil.obj2Str(detailItem));
//                                        if("付款类别".equals(itemMap.get("label")+"")){
//                                            applyReimbursementDetail.setFeeName(itemMap.get("value")+"");
//                                        }
//                                        if("付款总额".equals(itemMap.get("label")+"")){
//                                            if(itemMap.get("value") != null){
//                                                applyReimbursementDetail.setAmount(itemMap.get("value")+"".trim());
//                                            }
//
//                                        }
//                                    }
//                                    applyReimbursementDetail.setApproveId(businessId);
//                                    applyReimbursementDetail.setCreateTime(DateUtil.getNow());
//                                    applyReimbursementDetail.setAbstractNote(applyReimbursementDetail.getFeeName());
//                                    applyReimbursementDetail.setIndex((i+1)+"");
//                                    applyReimbursementDetails.add(applyReimbursementDetail);
//                                }
//
//
//                            }
//                        }
//                        resultMap.put("applyReimbursementDetails",applyReimbursementDetails);
//                    }
//
//
//
//                }else if("ryx".equals(companyType)){
//                    if("付款明细".equals(item.get("name")+"")){
//                        JSONArray detailArray = JSONArray.parseArray(item.get("value")+"");
//                        List<ApplyReimbursementDetail> applyReimbursementDetails = new ArrayList<>();
//                        if(detailArray != null){
//
//                            for (int i=0;i<detailArray.size();i++){
//                                Object detail =detailArray.get(i);
//                                ApplyReimbursementDetail applyReimbursementDetail = new ApplyReimbursementDetail();
//                                Map<String,Object> detailMap = JsonUtil.json2Map(JsonUtil.obj2Str(detail));
//                                List<Object> mapList = JsonUtil.json2List(JsonUtil.obj2Str(detailMap.get("rowValue")),Object.class);
//                                if(!CollectionUtils.isEmpty(mapList)){
//                                    for(Object detailItem:mapList){
//                                        Map<String,Object> itemMap = JsonUtil.json2Map(JsonUtil.obj2Str(detailItem));
//                                        if("付款类别".equals(itemMap.get("label")+"")){
//                                            applyReimbursementDetail.setFeeName(itemMap.get("value")+"");
//                                        }
//                                        if("付款金额(元)".equals(itemMap.get("label")+"")){
//                                            if(itemMap.get("value") != null){
//                                                applyReimbursementDetail.setAmount(itemMap.get("value")+"".trim());
//                                            }
//
//                                        }
//                                    }
//                                    applyReimbursementDetail.setApproveId(businessId);
//                                    applyReimbursementDetail.setCreateTime(DateUtil.getNow());
//                                    applyReimbursementDetail.setAbstractNote(applyReimbursementDetail.getFeeName());
//                                    applyReimbursementDetail.setIndex((i+1)+"");
//                                    applyReimbursementDetails.add(applyReimbursementDetail);
//                                }
//
//
//                            }
//                        }
//                        resultMap.put("applyReimbursementDetails",applyReimbursementDetails);
//                    }
//                }
//
//                resultMap.put("payType",payType);
//            }
//        }
//
//        List<ApplyReimbursementProcess> applyReimbursementProcessList = new ArrayList<>();
//        JSONArray taskArray = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.tasks").toString());
//        if(taskArray != null){
//            for(int i=1;i<=taskArray.size();i++){
//                Object taskItem = taskArray.get(i-1);
//                Map<String,Object> taskMap = JsonUtil.json2Map(JsonUtil.obj2Str(taskItem));
//                ApplyReimbursementProcess applyReimbursementProcess = new ApplyReimbursementProcess();
//                applyReimbursementProcess.setApproveId(businessId);
//                if(taskMap.get("create_time") != null){
//                    applyReimbursementProcess.setApproveTime(DateUtil.getDateTime(taskMap.get("create_time")+""));
//                }
//                applyReimbursementProcess.setApproveUserId(taskMap.get("userid")+"");
////                applyReimbursementProcess.setAproveIndex(i+"");
//                applyReimbursementProcess.setCreateTime(taskMap.get("finish_time") == null?null:DateUtil.getDateTime(taskMap.get("finish_time")+""));
//                applyReimbursementProcessList.add(applyReimbursementProcess);
//            }
//            Collections.sort(applyReimbursementProcessList);
//            Iterator<ApplyReimbursementProcess> it = applyReimbursementProcessList.iterator();
//
//            for(int i=0;i<applyReimbursementProcessList.size();i++){
//                ApplyReimbursementProcess process = applyReimbursementProcessList.get(i);
//                process.setAproveIndex((i+1)+"");
//            }
//        }
//
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            applyReimbursement.setApproveStatus(1);
//        }
//
//        resultMap.put("applyReimbursementProcessList",applyReimbursementProcessList);
//        resultMap.put("applyReimbursement",applyReimbursement);
//
//
//        return resultMap;
//
//
//
//
//    }
//
//
//    private static VocationApprove getVocationApproveDetail(String resp,String approveId){
//        VocationApprove vocationApprove = null;
//
//        String json = resp;
//        String approveResult = JSONPath.read(json, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(json, "$.process_instance.status").toString();
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            //流程结束，审批通过
//            JSONArray array = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.form_component_values").toString());
//            String businessId = JSONPath.read(json, "$.process_instance.business_id").toString();
//            Date create_time = DateUtil.getDateTime(JSONPath.read(json, "$.process_instance.create_time").toString());
//            String title = JSONPath.read(json, "$.process_instance.title").toString();
//            Date applyStartTime = null;
//            Date applyEndTime = null;
//            String userId = JSONPath.read(json, "$.process_instance.originator_userid").toString();
//            if(array != null){
//                for (Object obj : array) {
//                    Map<String, Object> map = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                    if ("[\"开始时间\",\"结束时间\"]".equals(map.get("name") + "")) {
//                        String ext_value = map.get("ext_value") + "";
//                        Map<String,Object> extValueMap = JsonUtil.json2Map(ext_value);
//                        String vocationType = JsonUtil.json2Map(extValueMap.get("extension")+"").get("tag")+"";
//                        List<Map<String,Object>> detailList = (List<Map<String,Object>>)extValueMap.get("detailList");
//                        Map<String,Object> detail = detailList.get(0);
//                        Map<String,Object> innerDetail = JsonUtil.json2Map(JsonUtil.obj2Str(detail.get("approveInfo")));
//                        applyStartTime = DateUtil.getDateTime(DateUtil.formatDateTime(new Date(Long.parseLong(innerDetail.get("fromTime")+""))));
//                        applyEndTime = DateUtil.getDateTime(DateUtil.formatDateTime(new Date(Long.parseLong(innerDetail.get("toTime")+""))));
//                        BigDecimal hours = new BigDecimal(innerDetail.get("durationInHour")+"");
//                        String name = title.split("的")[0];
//                        if("调休".equals(vocationType)){
//                            vocationApprove = new VocationApprove();
//                            vocationApprove.setProcessId(approveId);
//                            vocationApprove.setApproveId(businessId);
//                            vocationApprove.setUserId(userId);
//                            vocationApprove.setStartTime(applyStartTime);
//                            vocationApprove.setEndTime(applyEndTime);
//                            vocationApprove.setHours(hours);
//                            vocationApprove.setUserName(name);
//                            vocationApprove.setApproveTime(create_time);
//                        }
//                    }
//                }
//            }
//
//        }
//
//        return vocationApprove;
//
//    }
//
//
//
//    private static List<OverTimeDetail> getOverTimeDetailFc(String resp, String approveId,String companyType){
//        List<OverTimeDetail> overTimeDetails = new ArrayList<>();
//        String json = resp;
//        String approveResult = JSONPath.read(json, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(json, "$.process_instance.status").toString();
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            //流程结束，审批通过
//            JSONArray array = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.form_component_values").toString());
//            Date applyTime = DateUtil.getDate(JSONPath.read(json, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//            String overTimeUserValue = "";// 加班人数组字符
//            String overTimeStatAndEndValue = "";// 加班人数组字符
//            Date applyStartTime = null;
//            Date applyEndTime = null;
//            if (array != null) {
//                for (Object obj : array) {
//                    Map<String, Object> map = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                    if ("加班人".equals(map.get("name") + "")) {
//                        overTimeUserValue = map.get("ext_value") + "";
//                        LOG.info(overTimeUserValue);
//                    }
//                    if ("[\"开始时间\",\"结束时间\"]".equals(map.get("name") + "")) {
//                        overTimeStatAndEndValue = map.get("value") + "";
//
//                        JSONArray timeArray = JSONArray.parseArray(overTimeStatAndEndValue);
//                        applyStartTime = DateUtil.getDate(timeArray.get(0) + "", "yyyy-MM-dd HH:mm");
//                        applyEndTime = DateUtil.getDate(timeArray.get(1) + "", "yyyy-MM-dd HH:mm");
//
//                        LOG.info(overTimeStatAndEndValue);
//                    }
//                }
//            }
//            String extValue = overTimeUserValue;
//            String startTime = DateUtil.formatDateTime(applyStartTime);
//            String endTime = DateUtil.formatDateTime(applyEndTime);
//
//            LOG.info("extValue：{}" , extValue);
//            LOG.info("startTime：{}" , startTime);
//            LOG.info("endTime：{}" , endTime);
//
//            // 如果非工作日申请的加班时间跨天，拆分按天计算加班申请，中间时间去打卡时间
//            Integer difDay = DateUtil.getDiffDays(DateUtil.getDate(startTime), DateUtil.getDate(endTime));
//
//            if (difDay > 0 && DateUtil.getDiffSeconds(DateUtil.getDate(endTime.substring(0, 10) + " 08:45:00", "yyyy-MM-dd HH:mm:ss"), DateUtil.getDateTime(endTime)) <= 0) {
//                //结束时间未超过4点  算一天
//                --difDay;
//            }
//
//            Date startDate = DateUtil.getDate(startTime);
//            Date endDate = DateUtil.getDate(endTime);
//
//            List<Map> approveOverTimeUsers = JsonUtil.json2List(extValue, Map.class);
//            if (!CollectionUtils.isEmpty(approveOverTimeUsers)) {
//                for (Map overTimeUser : approveOverTimeUsers) {
//
//                    if (difDay == 0) {
//                        OverTimeDetail overTimeDetail = new OverTimeDetail();
//                        overTimeDetail.setCompanyType(companyType);
//                        overTimeDetail.setOverTimeApproveId(approveId);
//                        overTimeDetail.setUserId(overTimeUser.get("emplId") + "");
//                        overTimeDetail.setUserName(overTimeUser.get("name") + "");
//                        overTimeDetail.setApproveStartTime(DateUtil.getDateTime(startTime));
//                        overTimeDetail.setApproveEndTime(DateUtil.getDateTime(endTime));
//                        overTimeDetail.setOverTimeDate(DateUtil.getDate(startTime));
//                        overTimeDetail.setCreateTime(DateUtil.getNow());
//                        overTimeDetail.setUpdateTime(DateUtil.getNow());
//                        overTimeDetail.setApproveTime(applyTime);
//                        overTimeDetails.add(overTimeDetail);
//                    } else {
//                        for (int i = 0; i <= difDay; i++) {
//                            OverTimeDetail overTimeDetail = new OverTimeDetail();
//                            overTimeDetail.setCompanyType(companyType);
//                            overTimeDetail.setOverTimeApproveId(approveId);
//                            overTimeDetail.setUserId(overTimeUser.get("emplId") + "");
//                            overTimeDetail.setUserName(overTimeUser.get("name") + "");
//                            overTimeDetail.setCreateTime(DateUtil.getNow());
//                            overTimeDetail.setUpdateTime(DateUtil.getNow());
//                            overTimeDetail.setApproveTime(applyTime);
//                            if (i == 0) {
//                                overTimeDetail.setApproveStartTime(DateUtil.getDateTime(startTime));
//                                overTimeDetail.setApproveEndTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.getDateTime(startTime)) + " 18:00:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setOverTimeDate(DateUtil.getDate(startTime));
//                            } else if (i == difDay) {
//                                overTimeDetail.setApproveStartTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setApproveEndTime(DateUtil.getDateTime(endTime));
//                                overTimeDetail.setOverTimeDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00"));
//                            } else {
//                                overTimeDetail.setApproveStartTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setApproveEndTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00", "yyyy-MM-dd HH:mm:ss")) + " 18:00:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setOverTimeDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00"));
//                            }
//                            overTimeDetails.add(overTimeDetail);
//                        }
//                    }
//                }
//
//            }
//
//        }
//
//        return overTimeDetails;
//    }
//
//
//    public static List<OverTimeDetail> getOverTimeDetail(String resp, String approveId,String companyType) {
//        List<OverTimeDetail> overTimeDetails = new ArrayList<>();
//        String json = resp;
//        String approveResult = JSONPath.read(json, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(json, "$.process_instance.status").toString();
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            //流程结束，审批通过
//            JSONArray array = JSONArray.parseArray(JSONPath.read(json, "$.process_instance.form_component_values").toString());
//            Date applyTime = DateUtil.getDate(JSONPath.read(json, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//            String value = "";
//            if (array != null) {
//                for (Object obj : array) {
//                    Map<String, Object> map = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                    if ("加班".equals(map.get("name") + "")) {
//                        value = map.get("value") + "";
//                        LOG.info(value);
//                    }
//                }
//            }
//            String extValue = "";
//            String startTime = "";
//            String endTime = "";
//            List<DDOverTimeResp> ddOverTimeResps = JSONArray.parseArray(value, DDOverTimeResp.class);
//            if (!CollectionUtils.isEmpty(ddOverTimeResps)) {
//                for (DDOverTimeResp ddOverTimeResp : ddOverTimeResps) {
//                    if ("InnerContactField".equals(ddOverTimeResp.getComponentName())) {
//                        extValue = ddOverTimeResp.getExtValue();
//                    }
//                    if (ddOverTimeResp.getProps() != null) {
//                        Prop prop = ddOverTimeResp.getProps();
//                        if ("startTime".equals(prop.getBizAlias())) {
//                            startTime = ddOverTimeResp.getValue();
//                        }
//                        if ("finishTime".equals(prop.getBizAlias())) {
//                            endTime = ddOverTimeResp.getValue();
//                        }
//                    }
//                }
//            }
//            LOG.info("extValue：{}" , extValue);
//            LOG.info("startTime：{}" , startTime);
//            LOG.info("endTime：{}" , endTime);
//
//            // 如果非工作日申请的加班时间跨天，拆分按天计算加班申请，中间时间去打卡时间
//            Integer difDay = DateUtil.getDiffDays(DateUtil.getDate(startTime), DateUtil.getDate(endTime));
//
//            if (difDay > 0 && DateUtil.getDiffSeconds(DateUtil.getDate(endTime.substring(0, 10) + " 08:45:00", "yyyy-MM-dd HH:mm:ss"), DateUtil.getDateTime(endTime)) <= 0) {
//                //结束时间未超过4点  算一天
//                --difDay;
//            }
//
//            Date startDate = DateUtil.getDate(startTime);
//            Date endDate = DateUtil.getDate(endTime);
//
//            List<Map> approveOverTimeUsers = JsonUtil.json2List(extValue, Map.class);
//            if (!CollectionUtils.isEmpty(approveOverTimeUsers)) {
//                for (Map overTimeUser : approveOverTimeUsers) {
//
//
//                    if (difDay == 0) {
//                        OverTimeDetail overTimeDetail = new OverTimeDetail();
//                        overTimeDetail.setCompanyType(companyType);
//                        overTimeDetail.setOverTimeApproveId(approveId);
//                        overTimeDetail.setUserId(overTimeUser.get("emplId") + "");
//                        overTimeDetail.setUserName(overTimeUser.get("name") + "");
//                        overTimeDetail.setApproveStartTime(DateUtil.getDateTime(startTime));
//                        overTimeDetail.setApproveEndTime(DateUtil.getDateTime(endTime));
//                        overTimeDetail.setOverTimeDate(DateUtil.getDate(startTime));
//                        overTimeDetail.setCreateTime(DateUtil.getNow());
//                        overTimeDetail.setUpdateTime(DateUtil.getNow());
//                        overTimeDetail.setApproveTime(applyTime);
//                        overTimeDetails.add(overTimeDetail);
//                    } else {
//                        for (int i = 0; i <= difDay; i++) {
//                            OverTimeDetail overTimeDetail = new OverTimeDetail();
//                            overTimeDetail.setCompanyType(companyType);
//                            overTimeDetail.setOverTimeApproveId(approveId);
//                            overTimeDetail.setUserId(overTimeUser.get("emplId") + "");
//                            overTimeDetail.setUserName(overTimeUser.get("name") + "");
//                            overTimeDetail.setCreateTime(DateUtil.getNow());
//                            overTimeDetail.setUpdateTime(DateUtil.getNow());
//                            overTimeDetail.setApproveTime(applyTime);
//                            if (i == 0) {
//                                overTimeDetail.setApproveStartTime(DateUtil.getDateTime(startTime));
//                                overTimeDetail.setApproveEndTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.getDateTime(startTime)) + " 18:00:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setOverTimeDate(DateUtil.getDate(startTime));
//                            } else if (i == difDay) {
//                                overTimeDetail.setApproveStartTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setApproveEndTime(DateUtil.getDateTime(endTime));
//                                overTimeDetail.setOverTimeDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00"));
//                            } else {
//                                overTimeDetail.setApproveStartTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setApproveEndTime(DateUtil.getDate(DateUtil.formatDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00", "yyyy-MM-dd HH:mm:ss")) + " 18:00:00", "yyyy-MM-dd HH:mm:ss"));
//                                overTimeDetail.setOverTimeDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, DateUtil.getDateTime(startTime))) + " 08:45:00"));
//                            }
//                            overTimeDetails.add(overTimeDetail);
//                        }
//                    }
//                }
//
//            }
//
//        }
//
//        return overTimeDetails;
//    }
//
//    private Date judgeStartTime(Date startTime) {
//        Date result = null;
//        String compareDate = DateUtil.formatDate(startTime);
//        if (DateUtil.dateCompare(startTime, DateUtil.getDate(compareDate + " 08:45:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            //早于8.45
//            result = DateUtil.getDate(compareDate + " 08:45:00", "yyyy-MM-dd HH:mm:ss");
//        } else if (DateUtil.dateCompare(startTime, DateUtil.getDate(compareDate + " 12:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            result = startTime;
//        } else if (DateUtil.dateCompare(startTime, DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            result = DateUtil.getDate(compareDate + " 13:30:00", "yyyy-MM-dd HH:mm:ss");
//        } else if (DateUtil.dateCompare(startTime, DateUtil.getDate(compareDate + " 18:00:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            result = startTime;
//        } else if (DateUtil.dateCompare(startTime, DateUtil.getDate(compareDate + " 19:30:00", "yyyy-MM-dd HH:mm:ss")) == -1) {
//            result = DateUtil.getDate(compareDate + " 19:30:00", "yyyy-MM-dd HH:mm:ss");
//        } else {
//            result = startTime;
//        }
//        return result;
//    }
//
//    private static BigDecimal handingTimeO25(BigDecimal time) {
//        if (time == null) {
//            return new BigDecimal(0);
//        }
//        return time.divide(new BigDecimal(0.25)).setScale(0, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(0.25));
//    }
//
//    private static boolean isWeekend(Date date) {
//        Calendar cal = Calendar.getInstance();
//
//        cal.setTime(date);
//        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
//            return true;
//        }
//
//        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
//            return true;
//        }
//        return false;
//    }
//
//    private static boolean isHoliday(Date date, List<Holiday> holidays) {
//        if (!CollectionUtils.isEmpty(holidays)) {
//            for (Holiday holiday : holidays) {
//                if (DateUtil.getDiffDays(holiday.getHolidayDate(), date) == 0 && holiday.getIsHoliday()==1) {
//                    return true;
//                }
//            }
//            return false;
//        }
//        return false;
//    }
//
//    private static boolean isTriple(Date date, List<Holiday> holidays){
//        if (!CollectionUtils.isEmpty(holidays)) {
//            for (Holiday holiday : holidays) {
//                if (DateUtil.getDiffDays(holiday.getHolidayDate(), date) == 0 && holiday.getIsHoliday()==1 && holiday.getIsTriple()==1) {
//                    return true;
//                }
//            }
//            return false;
//        }
//        return false;
//    }
//
//    public void updateTimeRecordFromOnBusinessInfo(String approveStartTime,String approveEndTime) {
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//            List<String> approveIds = null;
//
//            Map<String, Object> approveIdsResult = requestForApproveIdsFromEip(this.onBusinessProcessCode, cursor, approveStartTime, approveEndTime);
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                return;
//            }
//            for (String approveId : approveIds) {
//                LOG.info("出差申请审批单号：{}" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String outBusinessDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    Map<String, Object> onBusinessDetail = null;
//                    if("fc".equals(this.companyType)){
//                        onBusinessDetail = getOnBusinessApplyUsersAndTimeFc(outBusinessDetailResp);
//                    }else {
//                        onBusinessDetail = getOnBusinessApplyUsersAndTime(outBusinessDetailResp);
//                    }
//                    if (onBusinessDetail == null) {
//                        continue;
//                    }
//                    List<String> applyUserIds = (List<String>) onBusinessDetail.get("applyUsers");
//                    Date starDate = (Date) onBusinessDetail.get("startDate");
//                    Date endDate = (Date) onBusinessDetail.get("endDate");
//
//                    // 如果申请的加班时间跨天，拆分按天计算加班申请，中间时间去打卡时间
//                    Integer difDay = DateUtil.getDiffDays(starDate, endDate);
//                    for (String applyUserId : applyUserIds) {
//                        for (int i = 0; i <= difDay; i++) {
//
//                            OverTimeDetail overTimeDetail = new OverTimeDetail();
//                            overTimeDetail.setOnBusinessApproveId(approveId);
//                            overTimeDetail.setUserId(applyUserId);
//                            overTimeDetail.setOnBusinessStartTime(DateUtil.addDay2Date(i, starDate));
//                            overTimeDetail.setOnBusinessEndTime(DateUtil.addDay2Date((difDay - i) * (-1), endDate));
//                            overTimeDetail.setOverTimeDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, starDate))));
//                            overTimeDetailService.update(overTimeDetail, new EntityWrapper<OverTimeDetail>().eq("user_id", applyUserId).eq("over_time_date", DateUtil.formatDate(DateUtil.addDay2Date(i, starDate))).eq("company_type",this.companyType));
//                        }
//                    }
//
//                }
//            }
//        }
//    }
//
//    private static Map<String, Object> getOnBusinessApplyUsersAndTimeFc(String outBusinessDetailResp) {
//        Map<String, Object> resultMap = new HashMap<>();
//        List<String> applyUsers = new ArrayList<>();
//        String approveResult = JSONPath.read(outBusinessDetailResp, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(outBusinessDetailResp, "$.process_instance.status").toString();
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            //流程结束，审批通过
//            JSONArray array = JSONArray.parseArray(JSONPath.read(outBusinessDetailResp, "$.process_instance.form_component_values").toString());
//            Date applyTime = DateUtil.getDate(JSONPath.read(outBusinessDetailResp, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//            if (array != null) {
//                for (Object obj : array) {
//                    Map<String, Object> map = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                    if ("申请人".equals(map.get("name") + "")) {
//                        String extValue = map.get("value") + "";
//                        applyUsers.add(HanyuPinyinHelper.toHanyuPinyin(extValue));
//                    }
//                    if ("商旅出差".equals(map.get("name") + "")) {
//                        List<DDOverTimeResp> ddOverTimeResps = JSONArray.parseArray(map.get("value") + "", DDOverTimeResp.class);
//                        for (DDOverTimeResp ddOverTimeResp : ddOverTimeResps) {
//                            if ("InnerContactField".equals(ddOverTimeResp.getComponentName())) {
//                                String extValue = ddOverTimeResp.getExtValue();
//                                JSONArray applyUserArray = JSONArray.parseArray(extValue);
//                                if (applyUserArray != null) {
//                                    for (Object applyUser : applyUserArray) {
//                                        Map<String, Object> userMap = JsonUtil.json2Map(JsonUtil.obj2Str(applyUser));
//                                        applyUsers.add(userMap.get("emplId") + "");
//                                    }
//                                }
//                            }
//                            if ("TableField".equals(ddOverTimeResp.getComponentName())) {
//                                String value = ddOverTimeResp.getValue();
//                                JSONArray jsonArray = JSONArray.parseArray(value).getJSONObject(0).getJSONArray("rowValue");
//                                for (Object detail : jsonArray) {
//                                    //2018-10-23 下午
//                                    Map<String, Object> detailMap = JsonUtil.json2Map(JsonUtil.obj2Str(detail));
//                                    if ("开始时间".equals(detailMap.get("label") + "")) {
//                                        String timeStr = detailMap.get("value") + "";
//                                        Date startDate = getOnbusinessDate(timeStr);
//                                        resultMap.put("startDate", startDate);
//                                    }
//                                    if ("结束时间".equals(detailMap.get("label") + "")) {
//                                        String timeStr = detailMap.get("value") + "";
//                                        Date endDate = getOnbusinessDate(timeStr);
//                                        resultMap.put("endDate", endDate);
//                                    }
//                                }
//                            }
//                        }
//                    }
//
//                }
//            }
//            resultMap.put("applyUsers", applyUsers);
//            return resultMap;
//        }
//        return null;
//    }
//
//    private Map<String, Object> getOnBusinessApplyUsersAndTime(String outBusinessDetailResp) {
//        Map<String, Object> resultMap = new HashMap<>();
//        List<String> applyUsers = new ArrayList<>();
//        String approveResult = JSONPath.read(outBusinessDetailResp, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(outBusinessDetailResp, "$.process_instance.status").toString();
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            //流程结束，审批通过
//            JSONArray array = JSONArray.parseArray(JSONPath.read(outBusinessDetailResp, "$.process_instance.form_component_values").toString());
//            Date applyTime = DateUtil.getDate(JSONPath.read(outBusinessDetailResp, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//            if (array != null) {
//                for (Object obj : array) {
//                    Map<String, Object> map = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                    if ("申请人".equals(map.get("name") + "")) {
//                        String extValue = map.get("ext_value") + "";
//                        JSONArray applyUserArray = JSONArray.parseArray(extValue);
//                        if (applyUserArray != null) {
//                            for (Object applyUser : applyUserArray) {
//                                Map<String, Object> userMap = JsonUtil.json2Map(JsonUtil.obj2Str(applyUser));
//                                applyUsers.add(userMap.get("emplId") + "");
//                            }
//                        }
//                    }
//                    if ("出差".equals(map.get("name") + "")) {
//                        List<DDOverTimeResp> ddOverTimeResps = JSONArray.parseArray(map.get("value") + "", DDOverTimeResp.class);
//                        for (DDOverTimeResp ddOverTimeResp : ddOverTimeResps) {
//                            if ("InnerContactField".equals(ddOverTimeResp.getComponentName())) {
//                                String extValue = ddOverTimeResp.getExtValue();
//                                JSONArray applyUserArray = JSONArray.parseArray(extValue);
//                                if (applyUserArray != null) {
//                                    for (Object applyUser : applyUserArray) {
//                                        Map<String, Object> userMap = JsonUtil.json2Map(JsonUtil.obj2Str(applyUser));
//                                        applyUsers.add(userMap.get("emplId") + "");
//                                    }
//                                }
//                            }
//                            if ("TableField".equals(ddOverTimeResp.getComponentName())) {
//                                String value = ddOverTimeResp.getValue();
//                                JSONArray jsonArray = JSONArray.parseArray(value).getJSONObject(0).getJSONArray("rowValue");
//                                for (Object detail : jsonArray) {
//                                    //2018-10-23 下午
//                                    Map<String, Object> detailMap = JsonUtil.json2Map(JsonUtil.obj2Str(detail));
//                                    if ("开始时间".equals(detailMap.get("label") + "")) {
//                                        String timeStr = detailMap.get("value") + "";
//                                        Date startDate = getOnbusinessDate(timeStr);
//                                        resultMap.put("startDate", startDate);
//                                    }
//                                    if ("结束时间".equals(detailMap.get("label") + "")) {
//                                        String timeStr = detailMap.get("value") + "";
//                                        Date endDate = getOnbusinessDate(timeStr);
//                                        resultMap.put("endDate", endDate);
//                                    }
//                                }
//                            }
//                        }
//                    }
//
//                }
//            }
//            resultMap.put("applyUsers", applyUsers);
//            return resultMap;
//        }
//        return null;
//    }
//
//    public void updateTimeRecordFromGoOutApplyInfo(String approveStartTime,String approveEndTime) {
//        Integer cursor = 0;
//        while (true) {
//            if(cursor==null){
//                break;
//            }
//            List<String> approveIds = null;
//
//            Map<String, Object> approveIdsResult = requestForApproveIdsFromEip(this.goOutProcessCode, cursor, approveStartTime, approveEndTime);
//            if (approveIdsResult != null) {
//                String approveIdsStr = approveIdsResult.get("approveIdsStr") + "";
//                if(approveIdsResult.get("cursor") == null){
//                    cursor = null;
//                }else {
//                    cursor = Integer.parseInt(approveIdsResult.get("cursor") + "");
//                }
//                approveIds = JSONArray.parseArray(approveIdsStr, String.class);
//            }
//            if (approveIds == null) {
//                return;
//            }
//            for (String approveId : approveIds) {
//                LOG.info("外出申请审批单号：{}" , approveId);
//                Map<String, Object> approvesDetails = requestForApproveDetailsFromEip(approveId);
//                if (approvesDetails != null) {
//                    String goOutDetailResp = approvesDetails.get("approveDetailResp") + "";
//                    Map<String, Object> goOUtDetail = null;
//                    if("fc".equals(this.companyType)){
//                        goOUtDetail = getGoOutApplyUsersAndTimeFc(goOutDetailResp);
//                    }else {
//                        goOUtDetail = getGoOutApplyUsersAndTime(goOutDetailResp);
//                    }
//                    if (goOUtDetail == null) {
//                        continue;
//                    }
//                    // 根据userId  和加班日期修改
//                    List<String> applyUsers = (List<String>) goOUtDetail.get("applyUsers");
//                    Date applyStartTime = (Date) goOUtDetail.get("applyStartTime");
//                    Date applyEndTime = (Date) goOUtDetail.get("applyEndTime");
//                    // 如果申请的加班时间跨天，拆分按天计算加班申请，中间时间去打卡时间
//                    Integer difDay = DateUtil.getDiffDays(applyStartTime, applyEndTime);
//
//                    if (difDay > 0 && DateUtil.getDiffSeconds(DateUtil.getDate(DateUtil.formatDate(applyEndTime).substring(0, 10) + " 08:45:00", "yyyy-MM-dd HH:mm:ss"), applyEndTime) <= 0) {
//                        //结束时间未超过08:45:00  算一天
//                        --difDay;
//                    }
//
//                    for (String applyUserId : applyUsers) {
//                        for (int i = 0; i <= difDay; i++) {
//
//                            OverTimeDetail overTimeDetail = new OverTimeDetail();
//                            overTimeDetail.setGoOutApproveId(approveId);
//                            overTimeDetail.setUserId(applyUserId);
//                            overTimeDetail.setGoOutStarTime(DateUtil.addDay2Date(i, applyStartTime));
//                            overTimeDetail.setGoOutEndTime(DateUtil.addDay2Date((difDay - i) * (-1), applyEndTime));
//                            overTimeDetail.setOverTimeDate(DateUtil.getDate(DateUtil.formatDate(DateUtil.addDay2Date(i, applyStartTime))));
//                            overTimeDetailService.update(overTimeDetail, new EntityWrapper<OverTimeDetail>().eq("user_id", applyUserId).eq("over_time_date", DateUtil.formatDate(DateUtil.addDay2Date(i, applyStartTime))).eq("company_type",this.companyType));
//                        }
//                    }
//
//                }
//            }
//        }
//    }
//
//    private static Map<String, Object> getGoOutApplyUsersAndTimeFc(String goOutDetailResp) {
//        Map<String, Object> resultMap = new HashMap<>();
//        List<String> applyUsers = new ArrayList<>();
//        String approveResult = JSONPath.read(goOutDetailResp, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(goOutDetailResp, "$.process_instance.status").toString();
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            //流程结束，审批通过
//            JSONArray array = JSONArray.parseArray(JSONPath.read(goOutDetailResp, "$.process_instance.form_component_values").toString());
//            Date applyTime = DateUtil.getDate(JSONPath.read(goOutDetailResp, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//            if (array != null) {
//                for (Object obj : array) {
//                    Map<String, Object> map = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                    if ("申请人".equals(map.get("name") + "")) {
//                        String extValue = map.get("value") + "";
//                        applyUsers.add(HanyuPinyinHelper.toHanyuPinyin(extValue));
//                        resultMap.put("applyUsers", applyUsers);
//                    }
//                    if ("[\"开始时间\",\"结束时间\"]".equals(map.get("name") + "")) {
//                        JSONArray timeArray = JSONArray.parseArray(map.get("value") + "");
//                        Date applyStartTime = DateUtil.getDate(timeArray.get(0) + "", "yyyy-MM-dd HH:mm");
//                        Date applyEndTime = DateUtil.getDate(timeArray.get(1) + "", "yyyy-MM-dd HH:mm");
//                        resultMap.put("applyStartTime", applyStartTime);
//                        resultMap.put("applyEndTime", applyEndTime);
//                    }
//
//                }
//            }
//            return resultMap;
//        }
//        return null;
//    }
//
//    private Map<String, Object> getGoOutApplyUsersAndTime(String goOutDetailResp) {
//        Map<String, Object> resultMap = new HashMap<>();
//        List<String> applyUsers = new ArrayList<>();
//        String approveResult = JSONPath.read(goOutDetailResp, "$.process_instance.result").toString();
//        String approveStatus = JSONPath.read(goOutDetailResp, "$.process_instance.status").toString();
//        if ("COMPLETED".equals(approveStatus) && "agree".equals(approveResult)) {
//            //流程结束，审批通过
//            JSONArray array = JSONArray.parseArray(JSONPath.read(goOutDetailResp, "$.process_instance.form_component_values").toString());
//            Date applyTime = DateUtil.getDate(JSONPath.read(goOutDetailResp, "$.process_instance.create_time").toString(), "yyyy-MM-dd HH:mm:ss");
//            if (array != null) {
//                for (Object obj : array) {
//                    Map<String, Object> map = JsonUtil.json2Map(JsonUtil.obj2Str(obj));
//                    if ("申请人".equals(map.get("name") + "")) {
//                        String extValue = map.get("ext_value") + "";
//                        JSONArray applyUserArray = JSONArray.parseArray(extValue);
//                        if (applyUserArray != null) {
//                            for (Object applyUser : applyUserArray) {
//                                Map<String, Object> userMap = JsonUtil.json2Map(JsonUtil.obj2Str(applyUser));
//                                applyUsers.add(userMap.get("emplId") + "");
//                                resultMap.put("applyUsers", applyUsers);
//                            }
//                        }
//                    }
//                    if ("[\"开始时间\",\"结束时间\"]".equals(map.get("name") + "")) {
//                        JSONArray timeArray = JSONArray.parseArray(map.get("value") + "");
//                        Date applyStartTime = DateUtil.getDate(timeArray.get(0) + "", "yyyy-MM-dd HH:mm");
//                        Date applyEndTime = DateUtil.getDate(timeArray.get(1) + "", "yyyy-MM-dd HH:mm");
//                        resultMap.put("applyStartTime", applyStartTime);
//                        resultMap.put("applyEndTime", applyEndTime);
//                    }
//
//                }
//            }
//            return resultMap;
//        }
//        return null;
//
//    }
//
//    private static Date getOnbusinessDate(String reqDate) {
//        Date date = null;
//        String[] dates = reqDate.split(" ");
//        if ("上午".equals(dates[1])) {
//            date = DateUtil.getDate(dates[0] + " 08:45:00", "yyyy-MM-dd HH:mm:ss");
//        } else {
//            date = DateUtil.getDate(dates[0] + " 18:00:00", "yyyy-MM-dd HH:mm:ss");
//        }
//        return date;
//    }
//
//    /**
//     * 获得该月第一天
//     * @return
//     */
//    public static String getFirstDayOfMonth(String date){
//        Calendar cal = Calendar.getInstance();
//        //设置年份
//        cal.setTime(DateUtil.getDate(date,"yyyy-MM"));
//        //获取某月最小天数
//        int firstDay = cal.getActualMinimum(Calendar.DAY_OF_MONTH);
//        //设置日历中月份的最小天数
//        cal.set(Calendar.DAY_OF_MONTH, firstDay);
//        //格式化日期
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//        String firstDayOfMonth = sdf.format(cal.getTime());
//        return firstDayOfMonth;
//    }
//
//    /**
//     * 获得该月最后一天
//     * @return
//     */
//    public static String getLastDayOfMonth(String date){
//        Calendar cal = Calendar.getInstance();
//        //设置年份
//        cal.setTime(DateUtil.getDate(date,"yyyy-MM"));
//        //获取某月最大天数
//        int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
//        //设置日历中月份的最大天数
//        cal.set(Calendar.DAY_OF_MONTH, lastDay);
//        //格式化日期
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//        String lastDayOfMonth = sdf.format(cal.getTime());
//        return lastDayOfMonth;
//    }
//
//
//    public static void main(String[] args) {
//        String json = "{\n" +
//                "    \"errcode\": 0,\n" +
//                "    \"process_instance\": {\n" +
//                "        \"approver_userids\": [\n" +
//                "            \"04015259431065169833\",\n" +
//                "            \"0616662504-2028409746\",\n" +
//                "            \"06166668051097470965\",\n" +
//                "            \"0616650420851129186\",\n" +
//                "            \"1743072620656397955\"\n" +
//                "        ],\n" +
//                "        \"attached_process_instance_ids\": [\n" +
//                "            \n" +
//                "        ],\n" +
//                "        \"biz_action\": \"NONE\",\n" +
//                "        \"business_id\": \"201902141538000003306\",\n" +
//                "        \"create_time\": \"2019-02-14 15:38:01\",\n" +
//                "        \"finish_time\": \"2019-02-14 16:33:05\",\n" +
//                "        \"form_component_values\": [\n" +
//                "            {\n" +
//                "                \"name\": \"报销公司\",\n" +
//                "                \"value\": \"深圳市富诚资产管理有限公司\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"name\": \"费用归属中心\",\n" +
//                "                \"value\": \"行政部\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"name\": \"收款单位\",\n" +
//                "                \"value\": \"东莞市安泰物业管理有限公司\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"value\": \"付款项目\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"ext_value\": \"{\\\"statValue\\\":[],\\\"componentName\\\":\\\"TableField\\\"}\",\n" +
//                "                \"name\": \"明细\",\n" +
//                "                \"value\": \"[{\\\"rowValue\\\":[{\\\"label\\\":\\\"付款类别\\\",\\\"value\\\":\\\"房租费用-物管费\\\",\\\"key\\\":\\\"DDSelectField-JMJWIHQ7\\\"},{\\\"label\\\":\\\"付款事由\\\",\\\"value\\\":\\\"2019年2月汇成大厦1406物业管理费。\\\",\\\"key\\\":\\\"费用明细\\\",\\\"extendValue\\\":{\\\"isRichText\\\":false}},{\\\"label\\\":\\\"付款总额\\\",\\\"value\\\":\\\"760\\\",\\\"key\\\":\\\"报销金额(元)\\\"}]},{\\\"rowValue\\\":[{\\\"label\\\":\\\"付款类别\\\",\\\"value\\\":\\\"房租费用-电费\\\",\\\"key\\\":\\\"DDSelectField-JMJWIHQ7\\\"},{\\\"label\\\":\\\"付款事由\\\",\\\"value\\\":\\\"2019年1月汇成大厦1406用电费用。\\\",\\\"key\\\":\\\"费用明细\\\",\\\"extendValue\\\":{\\\"isRichText\\\":false}},{\\\"label\\\":\\\"付款总额\\\",\\\"value\\\":\\\"862\\\",\\\"key\\\":\\\"报销金额(元)\\\"}]},{\\\"rowValue\\\":[{\\\"label\\\":\\\"付款类别\\\",\\\"value\\\":\\\"房租费用-水费\\\",\\\"key\\\":\\\"DDSelectField-JMJWIHQ7\\\"},{\\\"label\\\":\\\"付款事由\\\",\\\"value\\\":\\\"2019年1月汇成大厦1406用水费用。\\\",\\\"key\\\":\\\"费用明细\\\",\\\"extendValue\\\":{\\\"isRichText\\\":false}},{\\\"label\\\":\\\"付款总额\\\",\\\"value\\\":\\\"65\\\",\\\"key\\\":\\\"报销金额(元)\\\"}]}]\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"name\": \"付款方式\",\n" +
//                "                \"value\": \"转账\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"ext_value\": \"{\\\"upper\\\":\\\"壹仟陆佰捌拾柒元整\\\",\\\"componentName\\\":\\\"MoneyField\\\"}\",\n" +
//                "                \"name\": \"合计金额\",\n" +
//                "                \"value\": \"1687\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"name\": \"备注\",\n" +
//                "                \"value\": \"收款账号：500052491808019，开户行：东莞市东莞银行莞城支行\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"name\": \"附件\",\n" +
//                "                \"value\": \"[{\\\"spaceId\\\":\\\"986881274\\\",\\\"fileName\\\":\\\"缴费通知单1.JPG\\\",\\\"thumbnail\\\":{\\\"authCode\\\":\\\"\\\",\\\"authMediaId\\\":\\\"$iAEKAqNqcGcDAQTNAdEFzQJsBtoAI4QBpAsBZy4CqoSGziEbzoyKqaADzwAAAWjq8Gb6BM4AEnPQBwAIAA\\\",\\\"rotation\\\":0,\\\"width\\\":0,\\\"mediaId\\\":\\\"\\\",\\\"height\\\":0},\\\"fileSize\\\":2111456,\\\"fileType\\\":\\\"jpg\\\",\\\"fileId\\\":\\\"4584628987\\\"}]\"\n" +
//                "            }\n" +
//                "        ],\n" +
//                "        \"operation_records\": [\n" +
//                "            {\n" +
//                "                \"date\": \"2019-02-14 15:38:00\",\n" +
//                "                \"operation_result\": \"NONE\",\n" +
//                "                \"operation_type\": \"START_PROCESS_INSTANCE\",\n" +
//                "                \"userid\": \"061666532034947683\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"date\": \"2019-02-14 16:01:32\",\n" +
//                "                \"operation_result\": \"AGREE\",\n" +
//                "                \"operation_type\": \"EXECUTE_TASK_NORMAL\",\n" +
//                "                \"userid\": \"04015259431065169833\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"date\": \"2019-02-14 16:02:50\",\n" +
//                "                \"operation_result\": \"AGREE\",\n" +
//                "                \"operation_type\": \"EXECUTE_TASK_NORMAL\",\n" +
//                "                \"remark\": \"\",\n" +
//                "                \"userid\": \"0616662504-2028409746\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"date\": \"2019-02-14 16:05:05\",\n" +
//                "                \"operation_result\": \"AGREE\",\n" +
//                "                \"operation_type\": \"EXECUTE_TASK_NORMAL\",\n" +
//                "                \"remark\": \"\",\n" +
//                "                \"userid\": \"06166668051097470965\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"date\": \"2019-02-14 16:30:58\",\n" +
//                "                \"operation_result\": \"AGREE\",\n" +
//                "                \"operation_type\": \"EXECUTE_TASK_NORMAL\",\n" +
//                "                \"userid\": \"0616650420851129186\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"date\": \"2019-02-14 16:33:04\",\n" +
//                "                \"operation_result\": \"AGREE\",\n" +
//                "                \"operation_type\": \"EXECUTE_TASK_NORMAL\",\n" +
//                "                \"userid\": \"1743072620656397955\"\n" +
//                "            }\n" +
//                "        ],\n" +
//                "        \"originator_dept_id\": \"84842532\",\n" +
//                "        \"originator_dept_name\": \"行政部\",\n" +
//                "        \"originator_userid\": \"061666532034947683\",\n" +
//                "        \"result\": \"agree\",\n" +
//                "        \"status\": \"COMPLETED\",\n" +
//                "        \"tasks\": [\n" +
//                "            {\n" +
//                "                \"create_time\": \"2019-02-14 15:38:01\",\n" +
//                "                \"finish_time\": \"2019-02-14 16:01:33\",\n" +
//                "                \"task_result\": \"AGREE\",\n" +
//                "                \"task_status\": \"COMPLETED\",\n" +
//                "                \"taskid\": \"52030687728\",\n" +
//                "                \"userid\": \"04015259431065169833\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"create_time\": \"2019-02-14 16:01:33\",\n" +
//                "                \"finish_time\": \"2019-02-14 16:02:50\",\n" +
//                "                \"task_result\": \"AGREE\",\n" +
//                "                \"task_status\": \"COMPLETED\",\n" +
//                "                \"taskid\": \"52030687730\",\n" +
//                "                \"userid\": \"0616662504-2028409746\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"create_time\": \"2019-02-14 16:02:50\",\n" +
//                "                \"finish_time\": \"2019-02-14 16:05:06\",\n" +
//                "                \"task_result\": \"AGREE\",\n" +
//                "                \"task_status\": \"COMPLETED\",\n" +
//                "                \"taskid\": \"52030687732\",\n" +
//                "                \"userid\": \"06166668051097470965\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"create_time\": \"2019-02-14 16:05:06\",\n" +
//                "                \"finish_time\": \"2019-02-14 16:30:59\",\n" +
//                "                \"task_result\": \"AGREE\",\n" +
//                "                \"task_status\": \"COMPLETED\",\n" +
//                "                \"taskid\": \"52030687734\",\n" +
//                "                \"userid\": \"0616650420851129186\"\n" +
//                "            },\n" +
//                "            {\n" +
//                "                \"create_time\": \"2019-02-14 16:30:59\",\n" +
//                "                \"finish_time\": \"2019-02-14 16:33:05\",\n" +
//                "                \"task_result\": \"AGREE\",\n" +
//                "                \"task_status\": \"COMPLETED\",\n" +
//                "                \"taskid\": \"52030687736\",\n" +
//                "                \"userid\": \"1743072620656397955\"\n" +
//                "            }\n" +
//                "        ],\n" +
//                "        \"title\": \"行政专员-詹提交的FC-常用报销\"\n" +
//                "    },\n" +
//                "    \"request_id\": \"wv9a5fdnzm17\"\n" +
//                "}";
//        System.out.println(JsonUtil.obj2Str(getExpenseAccountForRyx(json,"dsadas","fc")));
////        System.out.println(DateUtil.getDateTime("2018-09-01 00:00:00").getTime());
//    }
//
//}
